You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
I've been able to reproduce this bug in Odoo v16 Enterprise Edition as well. After further investigation, I've identified some additional details about the issue:
Root Cause
The issue appears to be linked with the recalculation of the User Types / Internal User group. When the last role containing the User Types / Internal User group is removed (even temporarily without saving), the user type is reset. This reset causes the user's notification type to revert to its default value (email).
Explanation
This behavior is consistent with normal Odoo operations regarding user types. When all roles containing the Internal User group are removed, even momentarily, Odoo recalculates the user type, which triggers a reset of user preferences, including the notification type.
Workaround
To prevent this reset from occurring, it's crucial to always maintain at least one role that contains the User Types / Internal User group for each user. Here's a step-by-step process to safely modify roles without triggering the reset:
When replacing Role A with Role B (assuming both contain the Internal User group):
a. First, add Role B to the user
b. Save the changes
c. Then, remove Role A
This approach ensures that the Internal User group is never completely removed during the process, avoiding the recalculation of the user type.
Alternative Solution
Create a separate user group dedicated to containing only the User Types / Internal User group. Always keep this group assigned to the user. This allows you to freely add, remove, or replace other roles without forcing a recalculation of the user type, thus avoiding the reset of user communication preferences.
SiesslPhillip
pushed a commit
to grueneerde/OCA-server-backend
that referenced
this issue
Nov 20, 2024
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:
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
The text was updated successfully, but these errors were encountered: