diff options
| author | Victor Feyens <vfe@odoo.com> | 2020-02-20 10:05:44 +0000 |
|---|---|---|
| committer | Victor Feyens <vfe@odoo.com> | 2020-02-20 14:51:13 +0000 |
| commit | 6d94f02ea192cccae6b7f80dccaf112624177d8d (patch) | |
| tree | de6cf4b4d0de838bde1bc6e7a3d22c867d21303a /addons | |
| parent | f823d1b8475b2aeb1eac93b0222c0a27e79c4fb5 (diff) | |
[IMP] sales_team: member_ids search performance.
Each search on member_ids will trigger a ref call (one exists query each
time), whereas we could just directly use the appropriate share field on
res_users.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/sales_team/models/crm_team.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sales_team/models/crm_team.py b/addons/sales_team/models/crm_team.py index 9c3c0ef349b..4b84837c506 100644 --- a/addons/sales_team/models/crm_team.py +++ b/addons/sales_team/models/crm_team.py @@ -46,7 +46,7 @@ class CrmTeam(models.Model): user_id = fields.Many2one('res.users', string='Team Leader', check_company=True) member_ids = fields.One2many( 'res.users', 'sale_team_id', string='Channel Members', check_company=True, - domain=lambda self: [('groups_id', 'in', self.env.ref('base.group_user').id)], + domain=[('share', '=', False)], help="Add members to automatically assign their documents to this sales team. You can only be member of one team.") favorite_user_ids = fields.Many2many( 'res.users', 'team_favorite_user_rel', 'team_id', 'user_id', |
