Search users by roles using the proper role field

The fields roles is a One2Many so we must search on the target role field.

issue9226
review305391003
This commit is contained in:
Cédric Krier committed 2020-04-23 22:37:15 +02:00
1 parent de93f1946d
commit 7e87422fd8
1 file changed
+1 -1
+1 -1
View File
@@ -21,7 +21,7 @@ class Role(ModelSQL, ModelView):
super().write(*args)
users = User.search([
('roles', 'in', [r.id for r in roles]),
('roles.role', 'in', [r.id for r in roles]),
])
User.sync_roles(users)