[16.0][FIX] mail_activity_team, fix double send activity notification #1431
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First notification is sent by
https://github.com/odoo/odoo/blob/16.0/addons/mail/models/mail_activity.py#L348
Because new field team_user_id is a related field, when both field are passed to create function, trigger a write to sync fields, because that in validation of change of user is trigger and send as a write
Second notification is send by this one, this is default when record is created
https://github.com/odoo/odoo/blob/16.0/addons/mail/models/mail_activity.py#L302-L303
With change proposed, send same value to both fields if team_user_id is filled
@ForgeFlow