[FIX] base: display Other category in warning message if debug=false

Before this commit, when the user changes the access rights of another
user, he will see a warning message the other access rights will change
with his changes. In that warning message, `Other` category could be
displayed and that category is only displayed in the user form view if
the user is in debug mode since it is a Technical category.

This commit hides the `Other` category in the warning message when the
user is not in debug mode to be consistent with the visibility of that
category in the form view.

task-3049636

X-original-commit: 9998ec50652a0c9b66e5f2b2c0ef5ce30861b79f
Part-of: odoo/odoo#118825
This commit is contained in:
Pratik Awasthi
2023-04-17 19:07:48 +02:00
parent 00adcfa2fc
commit 0ace060fc1
+2 -1
View File
@@ -1635,7 +1635,8 @@ class UsersView(models.Model):
missing_implied_groups = missing_implied_groups.filtered(
lambda g:
g.category_id not in (group.category_id | categories_to_ignore) and
g not in current_groups_by_category[g.category_id]
g not in current_groups_by_category[g.category_id] and
(self.user_has_groups('base.group_no_one') or g.category_id)
)
if missing_implied_groups:
# prepare missing group message, by categories