[FIX] Use all users (disabled also) in execute of res_config for implies group. Else, public user or old user don't get the right permission/group.
bzr revid: jke@openerp.com-20140326140509-7zspikcekfsyjb0p
This commit is contained in:
parent
6ad8096210
commit
c2e259d8a3
|
@ -493,6 +493,10 @@ class res_config_settings(osv.osv_memory, res_config_module_installation_mixin):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def execute(self, cr, uid, ids, context=None):
|
def execute(self, cr, uid, ids, context=None):
|
||||||
|
if context is None:
|
||||||
|
context = {}
|
||||||
|
|
||||||
|
context = dict(context, active_test=False)
|
||||||
if uid != SUPERUSER_ID and not self.pool['res.users'].has_group(cr, uid, 'base.group_erp_manager'):
|
if uid != SUPERUSER_ID and not self.pool['res.users'].has_group(cr, uid, 'base.group_erp_manager'):
|
||||||
raise openerp.exceptions.AccessError(_("Only administrators can change the settings"))
|
raise openerp.exceptions.AccessError(_("Only administrators can change the settings"))
|
||||||
|
|
||||||
|
@ -500,7 +504,7 @@ class res_config_settings(osv.osv_memory, res_config_module_installation_mixin):
|
||||||
ir_module = self.pool['ir.module.module']
|
ir_module = self.pool['ir.module.module']
|
||||||
res_groups = self.pool['res.groups']
|
res_groups = self.pool['res.groups']
|
||||||
|
|
||||||
classified = self._get_classified_fields(cr, uid, context)
|
classified = self._get_classified_fields(cr, uid, context=context)
|
||||||
|
|
||||||
config = self.browse(cr, uid, ids[0], context)
|
config = self.browse(cr, uid, ids[0], context)
|
||||||
|
|
||||||
|
|
|
@ -586,7 +586,7 @@ class groups_implied(osv.osv):
|
||||||
res = super(groups_implied, self).write(cr, uid, ids, values, context)
|
res = super(groups_implied, self).write(cr, uid, ids, values, context)
|
||||||
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 g in self.browse(cr, uid, ids):
|
for g in self.browse(cr, uid, ids, context=context):
|
||||||
gids = map(int, g.trans_implied_ids)
|
gids = map(int, g.trans_implied_ids)
|
||||||
vals = {'users': [(4, u.id) for u in g.users]}
|
vals = {'users': [(4, u.id) for u in g.users]}
|
||||||
super(groups_implied, self).write(cr, uid, gids, vals, context)
|
super(groups_implied, self).write(cr, uid, gids, vals, context)
|
||||||
|
|
Loading…
Reference in New Issue