server-backend icon indicating copy to clipboard operation
server-backend copied to clipboard

base_user_role resets Notification User preference

Open Marrieta99 opened this issue 1 year ago • 4 comments

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:

  1. A user changes their notification_type selection from 'Handle by Emails' (default) to 'Handle in Odoo'
  2. The user's roles list is modified (A role is added or removed)
  3. 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

Marrieta99 avatar Jun 12 '24 20:06 Marrieta99

@chienandalu

Bart-dh avatar Jul 08 '24 07:07 Bart-dh

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 avatar Jul 08 '24 08:07 chienandalu

@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

Bart-dh avatar Jul 25 '24 08:07 Bart-dh

It's inside the scope, as Odoo is not considering CC unless a contact matching the email address exists, and this module does it.

pedrobaeza avatar Jul 25 '24 17:07 pedrobaeza

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.

github-actions[bot] avatar Jan 26 '25 12:01 github-actions[bot]