base_user_role resets Notification User preference
Module
base_user_role
Describe the bug
When a user's roles are altered,
To Reproduce
Affected versions: V17 at least, have not tried it in other versions
Steps to reproduce the behavior:
- A user changes their notification_type selection from 'Handle by Emails' (default) to 'Handle in Odoo'
- The user's roles list is modified (A role is added or removed)
- The user's notification_type has been set back to 'Handle by Emails'
Expected behavior User's notification handling preferences shouldn't change, regardless of their roles
Additional context Found this bug in my Odoo.sh instance. Version is 17.0+e (Enterprise Edition) The bug was found in my productive (main) branch, and successfully replicated in a fresh dev database with only the base_user_role module installed
@chienandalu
Hi, @Bart-dh
It could be that the original mail had that [email protected] in the extra recipients, which are added to the suggested recipients for the message replies:
https://github.com/OCA/social/blob/27f38091da019420b4599c978295d4fd0094e76a/mail_tracking/models/mail_thread.py#L65-L73
We try to dectect the existing aliases:
https://github.com/OCA/social/blob/27f38091da019420b4599c978295d4fd0094e76a/mail_tracking/models/mail_thread.py#L77
In order to discard them
https://github.com/OCA/social/blob/27f38091da019420b4599c978295d4fd0094e76a/mail_tracking/models/mail_thread.py#L90-L94
This is where we retrieve them (in v17 there's a new way to set the catchall with the mail.alias.domain records that allow multi-domain catchalls):
https://github.com/OCA/social/blob/27f38091da019420b4599c978295d4fd0094e76a/mail_tracking/models/mail_alias.py#L10-L23
Also check if a partner could have that catchall email set, as it could be that is assigning it directly: https://github.com/OCA/social/blob/27f38091da019420b4599c978295d4fd0094e76a/mail_tracking/models/mail_thread.py#L85-L86
@chienandalu what is the reason for adding extra suggested recipients? To me it looks like extra functionality which is irrelevant to the rest of this module, but I could be mistaken
It's inside the scope, as Odoo is not considering CC unless a contact matching the email address exists, and this module does it.
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.