Browse Source

Merge pull request #142 from akretion/10-small-improvements

[10.0] Allow to work with asterisk server not company-related
pull/149/head
Alexis de Lattre 7 years ago
committed by GitHub
parent
commit
fcb4e5a445
  1. 5
      asterisk_click2dial/models/res_users.py

5
asterisk_click2dial/models/res_users.py

@ -96,8 +96,9 @@ class ResUsers(models.Model):
if self.asterisk_server_id: if self.asterisk_server_id:
ast_server = self.asterisk_server_id ast_server = self.asterisk_server_id
else: else:
asterisk_servers = self.env['asterisk.server'].search(
[('company_id', '=', self.company_id.id)])
asterisk_servers = self.env['asterisk.server'].search([
'|', ('company_id', '=', self.company_id.id),
('company_id', '=', False)], order='company_id')
# If the user doesn't have an asterisk server, # If the user doesn't have an asterisk server,
# we take the first one of the user's company # we take the first one of the user's company
if not asterisk_servers: if not asterisk_servers:

Loading…
Cancel
Save