Skip to content

[FIX] base_user_role: don't reset notification_type#456

Open
mprechl wants to merge 1 commit into
OCA:19.0from
mprechl:19.0-fix-base_user_role-notification-type
Open

[FIX] base_user_role: don't reset notification_type#456
mprechl wants to merge 1 commit into
OCA:19.0from
mprechl:19.0-fix-base_user_role-notification-type

Conversation

@mprechl
Copy link
Copy Markdown

@mprechl mprechl commented May 10, 2026

Problem

The 19.0 migration of base_user_role dropped the
_get_self_writable_groups method that was present in 18.0. This method
excluded mail.group_mail_notification_type_inbox from the role
enforcement 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 to res.users, or at latest on the next run of the
cron_update_users scheduled action.

Solution

Restore _get_self_writable_groups from the 18.0 implementation and use
it in set_groups_from_roles to exclude mail.group_mail_notification_type_inbox
from both sides of the group diff, exactly as was done before the
migration.

References

… 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.
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @jcdrubay, @novawish, @sebalix,
some modules you are maintaining are being modified, check this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants