Skip to content

Commit

Permalink
[MERGE] forward port branch 10.0 up to 5f12e24
Browse files Browse the repository at this point in the history
  • Loading branch information
KangOl committed Jan 10, 2019
2 parents 390d859 + 5f12e24 commit a449b06
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions odoo/addons/base/res/res_users.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -662,8 +662,26 @@ def write(self, values):
if values.get('users') or values.get('implied_ids'): if values.get('users') or values.get('implied_ids'):
# add all implied groups (to all users of each group) # add all implied groups (to all users of each group)
for group in self: for group in self:
vals = {'users': zip(repeat(4), group.with_context(active_test=False).users.ids)} self._cr.execute("""
super(GroupsImplied, group.trans_implied_ids).write(vals) WITH RECURSIVE group_imply(gid, hid) AS (
SELECT gid, hid
FROM res_groups_implied_rel
UNION
SELECT i.gid, r.hid
FROM res_groups_implied_rel r
JOIN group_imply i ON (i.hid = r.gid)
)
INSERT INTO res_groups_users_rel (gid, uid)
SELECT i.hid, r.uid
FROM group_imply i, res_groups_users_rel r
WHERE r.gid = i.gid
AND i.gid = %(gid)s
EXCEPT
SELECT r.gid, r.uid
FROM res_groups_users_rel r
JOIN group_imply i ON (r.gid = i.hid)
WHERE i.gid = %(gid)s
""", dict(gid=group.id))
return res return res




Expand Down

0 comments on commit a449b06

Please sign in to comment.