Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] mail_activity_team, fix double send activity notification #1431

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions mail_activity_team/models/mail_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ def _get_default_team_id(self, user_id=None):
index=True,
)

@api.model_create_multi
def create(self, values):
for value in values:
if "team_user_id" in value and value.get(
"team_user_id", False
) != value.get("user_id"):
value.update({"user_id": value.get("team_user_id", False)})
return super().create(values)

@api.onchange("user_id")
def _onchange_user_id(self):
if not self.user_id or (
Expand Down
Loading