From 7e87422fd8ca7e2eb8b846aba0c6e0aa316c03bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 23 Apr 2020 22:37:15 +0200 Subject: [PATCH] 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 --- res.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res.py b/res.py index 9c949fce62..9b437ed6de 100644 --- a/res.py +++ b/res.py @@ -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)