[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:
Jeremy Kersten
2016-06-20 13:38:26 +02:00
parent 6ad47aeb68
commit 757a917088
+1 -1
View File
@@ -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