Browse Source

[FIX] user_id changing to activity team leader by default

pull/350/head
Adrià Gil Sorribes 6 years ago
committed by Jordi Ballester Alomar
parent
commit
8e0898108f
  1. 5
      mail_activity_team/models/mail_activity.py

5
mail_activity_team/models/mail_activity.py

@ -46,12 +46,11 @@ class MailActivity(models.Model):
if not self.team_id: if not self.team_id:
return res return res
res['domain']['user_id'] = [('id', 'in', self.team_id.member_ids.ids)] res['domain']['user_id'] = [('id', 'in', self.team_id.member_ids.ids)]
if self.user_id not in self.team_id.member_ids:
if self.team_id.user_id: if self.team_id.user_id:
self.user_id = self.team_id.user_id self.user_id = self.team_id.user_id
elif len(self.team_id.member_ids.ids) == 1:
elif len(self.team_id.member_ids) == 1:
self.user_id = self.team_id.member_ids self.user_id = self.team_id.member_ids
elif self.env.user.id in self.team_id.member_ids.ids:
self.user_id = self.env.user
else: else:
self.user_id = self.env['res.users'] self.user_id = self.env['res.users']
return res return res

Loading…
Cancel
Save