[18.0][IMP] mail_activity_team: Optional notify for team members#148
[18.0][IMP] mail_activity_team: Optional notify for team members#148
Conversation
bcc5796 to
13ac7b7
Compare
13ac7b7 to
0dfdcc9
Compare
|
@StefanRijnhart @lorenzomorandini could you have a look? |
|
@CRogos it seemes to me that the assigned user received a double notification because of the You could exclude |
0dfdcc9 to
babda9a
Compare
|
LGTM |
|
@lorenzomorandini you need to post the Review here: |
StefanRijnhart
left a comment
There was a problem hiding this comment.
A couple of things that may not be handled correctly:
- Team members may not be notified if the activity is assigned to the current user, as action_notify is not called (https://github.com/odoo/odoo/blob/42ea101/addons/mail/models/mail_activity.py#L282)
- action_notify may not be called with sudo even if there are members with unreadable partners (cf. https://github.com/odoo/odoo/blob/42ea101/addons/mail/models/mail_activity.py#L283-L287)
- if the user of the activity is updated, then we don't want all the team members to receive a notification (or even the newly assigned user itself, if they are a team member) (see https://github.com/odoo/odoo/blob/42ea101/addons/mail/models/mail_activity.py#L325-L328). Now, if a new team is assigned, we may want to notify the members of the team, but this is currently not triggered.
|
This PR has the |
I think the idea behind this is that, if you create an activity for yourself, you are aware of this activity and take action. I think there are arguments for both behaviors (notify/not notify) the team. Leave it as is? Make it configurable? What do you think?
I don't understand why sudo() is not called always? I'll check if it sufficient to call sudo() when accessing partner_id
I think I implement action_notify_team which gets called by action_notify, but can also be called in this case. Thanks for your input. I'm working on an update. |
Ideally, notifications would be send for all users (team + activity user) excluding the creating user.
Agreed!
👍 You could consider circumventing the regular action_notify if a team with the send-team-notifications option is assigned, then duplicating the create and write logic from the original model to trigger calls to this new |
07dd3b8 to
3db0be5
Compare
…rove team user assignment
3db0be5 to
3149783
Compare

Add the option to send notifications to the team members.
Bugfix: If a team is selected, no notification was send to the user_id because it is replaced by team_user_id.
(Why do we have team_user_id anyway? Shouldn't be user_id sufficent?)