Browse Source

Allow to work with asterisk server not company-related

pull/142/head
Alexis de Lattre 7 years ago
parent
commit
348bd199f9
  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