Browse Source

Merge pull request #350 from Eficent/11.0-fix-mail_activity_team

[FIX] mail_activity_team
pull/355/head
Jordi Ballester Alomar 6 years ago
committed by GitHub
parent
commit
649c87f86b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      mail_activity_team/models/mail_activity.py

15
mail_activity_team/models/mail_activity.py

@ -46,14 +46,13 @@ 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.team_id.user_id:
self.user_id = self.team_id.user_id
elif len(self.team_id.member_ids.ids) == 1:
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:
self.user_id = self.env['res.users']
if self.user_id not in self.team_id.member_ids:
if self.team_id.user_id:
self.user_id = self.team_id.user_id
elif len(self.team_id.member_ids) == 1:
self.user_id = self.team_id.member_ids
else:
self.user_id = self.env['res.users']
return res return res
@api.multi @api.multi

Loading…
Cancel
Save