changeset 202728c0c6aa in modules/user_role:5.4
details: https://hg.tryton.org/modules/user_role?cmd=changeset;node=202728c0c6aa
description:
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
(grafted from cea778b779bb3f8f0c072ee108e3282569ed7fd5)
diffstat:
res.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r 15c4b30f76b0 -r 202728c0c6aa res.py
--- a/res.py Sat Apr 04 16:53:06 2020 +0200
+++ b/res.py Thu Apr 23 22:37:15 2020 +0200
@@ -21,7 +21,7 @@
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)