[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.
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user