changeset a96158900bbb in modules/user_role:5.2
details: https://hg.tryton.org/modules/user_role?cmd=changeset;node=a96158900bbb
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 874ef7536513 -r a96158900bbb res.py
--- a/res.py    Sat Apr 04 17:22:19 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)
 

Reply via email to