Skip to content

[18.0][IMP] mail_activity_team: Optional notify for team members#148

Open
CRogos wants to merge 1 commit intoOCA:18.0from
c4a8-odoo:18.0-mail_activity_team-notify
Open

[18.0][IMP] mail_activity_team: Optional notify for team members#148
CRogos wants to merge 1 commit intoOCA:18.0from
c4a8-odoo:18.0-mail_activity_team-notify

Conversation

@CRogos
Copy link
Contributor

@CRogos CRogos commented Feb 11, 2026

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?)

image

@CRogos CRogos force-pushed the 18.0-mail_activity_team-notify branch from bcc5796 to 13ac7b7 Compare February 11, 2026 14:05
@CRogos CRogos changed the title [18.0][IMP] mail_activity_team: Optional notify for teams [18.0][IMP] mail_activity_team: Optional notify for team members Feb 11, 2026
Copy link

@MohamedOsman7 MohamedOsman7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CRogos CRogos force-pushed the 18.0-mail_activity_team-notify branch from 13ac7b7 to 0dfdcc9 Compare February 11, 2026 15:52
@CRogos
Copy link
Contributor Author

CRogos commented Feb 17, 2026

@StefanRijnhart @lorenzomorandini could you have a look?

@lorenzomorandini
Copy link

@CRogos it seemes to me that the assigned user received a double notification because of the result = super().action_notify().

You could exclude user_id from team_members

@CRogos CRogos force-pushed the 18.0-mail_activity_team-notify branch from 0dfdcc9 to babda9a Compare February 17, 2026 14:04
@lorenzomorandini
Copy link

LGTM

@CRogos
Copy link
Contributor Author

CRogos commented Feb 17, 2026

@lorenzomorandini you need to post the Review here:
image

Copy link

@lorenzomorandini lorenzomorandini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of things that may not be handled correctly:

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@CRogos
Copy link
Contributor Author

CRogos commented Feb 17, 2026

A couple of things that may not be handled correctly:

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

                        record.message_notify(
                            partner_ids=member.sudo().partner_id.ids,

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.

@StefanRijnhart
Copy link
Member

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?

Ideally, notifications would be send for all users (team + activity user) excluding the creating user.

I don't understand why sudo() is not called always? I'll check if it sufficient to call sudo() when accessing partner_id

Agreed!

I think I implement action_notify_team which gets called by action_notify, but can also be called in this case.

👍

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 action_notify_team method.

@CRogos CRogos force-pushed the 18.0-mail_activity_team-notify branch 3 times, most recently from 07dd3b8 to 3db0be5 Compare February 18, 2026 13:12
@CRogos CRogos force-pushed the 18.0-mail_activity_team-notify branch from 3db0be5 to 3149783 Compare February 18, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments