[FIX] base_user_role: don't reset notification_type#456
Open
mprechl wants to merge 1 commit into
Open
Conversation
… role sync Restore _get_self_writable_groups method and its usage in set_groups_from_roles, which was dropped during the migration to 19.0 (PR OCA#382). In 18.0, this method excluded `mail.group_mail_notification_type_inbox` from the group enforcement logic, so that the notification preference set by a user was not overwritten by the role sync.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The 19.0 migration of
base_user_roledropped the_get_self_writable_groupsmethod that was present in 18.0. This methodexcluded
mail.group_mail_notification_type_inboxfrom the roleenforcement logic in
set_groups_from_roles.The result is that any user with roles assigned can never persistently set
their notification preference to "In Odoo" — it gets reset on every
write()call tores.users, or at latest on the next run of thecron_update_usersscheduled action.Solution
Restore
_get_self_writable_groupsfrom the 18.0 implementation and useit in
set_groups_from_rolesto excludemail.group_mail_notification_type_inboxfrom both sides of the group diff, exactly as was done before the
migration.
References