Skip to content

Commit

Permalink
[IMP] mail_activity_team: filter fix, follow-up comments
Browse files Browse the repository at this point in the history
Taken from the 16.0 branch after the merge of OCA#1280
which was picked for the migration of this module for 17.0 in an earlier stage.
  • Loading branch information
ntodorova authored and Wodran14 committed Jan 23, 2025
1 parent 89da1b1 commit 0f672a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mail_activity_team/models/mail_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def _get_default_team_id(self, user_id=None):
)

team_id = fields.Many2one(
comodel_name="mail.activity.team", default=lambda s: s._get_default_team_id()
comodel_name="mail.activity.team",
default=lambda s: s._get_default_team_id(),
index=True,
)

@api.onchange("user_id")
Expand Down
2 changes: 1 addition & 1 deletion mail_activity_team/models/mail_activity_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _compute_my_activity_date_deadline(self):
activity.date_deadline
for activity in record.activity_ids
if activity.user_id.id == record.env.uid
or activity.team_id.id in record.env.user.activity_team_ids.ids
or activity.team_id in record.env.user.activity_team_ids
),
False,
)
3 changes: 3 additions & 0 deletions mail_activity_team/tests/test_mail_activity_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ def test_schedule_activity_from_server_action(self):
self.assertEqual(partner.activity_ids[-1].team_id, self.team2)

def test_my_activity_date_deadline(self):
"""This test case checks
- if the team activities are properly filtered
"""
today = date.today()
self.act2.write(
{
Expand Down

0 comments on commit 0f672a8

Please sign in to comment.