[FIX] base: add disabled users at write on 'users' or 'implied_ids' of res_group
If a user is disabled but in a implied_ids group, it was ignored and
so not added.
Eg: public_user is by default disabled,
So:
<record model="res.groups" id="base.group_public">
<field name="implied_ids" eval="[(4, ref('foo'))]"/>
</record>
will not add the public_user in group foo.
It is coherent with the method execute of resConfig which already use the
active_test=False.
Courtesy of @odony for review
This commit is contained in:
@@ -614,7 +614,7 @@ class GroupsImplied(models.Model):
|
||||
if values.get('users') or values.get('implied_ids'):
|
||||
# add all implied groups (to all users of each group)
|
||||
for group in self:
|
||||
vals = {'users': zip(repeat(4), group.users.ids)}
|
||||
vals = {'users': zip(repeat(4), group.with_context(active_test=False).users.ids)}
|
||||
super(GroupsImplied, group.trans_implied_ids).write(vals)
|
||||
return res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user