|
|
@ -46,7 +46,6 @@ class MailActivityTeam(models.Model): |
|
|
|
user_id = fields.Many2one( |
|
|
|
comodel_name='res.users', |
|
|
|
string='Team Leader', |
|
|
|
domain="[('id', 'in', member_ids)]", |
|
|
|
) |
|
|
|
count_missing_activities = fields.Integer( |
|
|
|
string="Missing Activities", |
|
|
@ -59,6 +58,13 @@ class MailActivityTeam(models.Model): |
|
|
|
if self.user_id and self.user_id not in self.member_ids: |
|
|
|
self.user_id = False |
|
|
|
|
|
|
|
@api.onchange('user_id') |
|
|
|
def _onchange_user_id(self): |
|
|
|
if self.user_id and self.user_id not in self.member_ids: |
|
|
|
members_ids = self.member_ids.ids |
|
|
|
members_ids.append(self.user_id.id) |
|
|
|
self.member_ids = [(4, member) for member in members_ids] |
|
|
|
|
|
|
|
def assign_team_to_unassigned_activities(self): |
|
|
|
activity_model = self.env['mail.activity'] |
|
|
|
for team in self: |
|
|
|