Browse Source

setting permissions bug fixed?

pull/6/head
Mathias Markl 6 years ago
parent
commit
fb7cbab3e5
  1. 2
      muk_utils/__manifest__.py
  2. 9
      muk_utils/models/res_users.py

2
muk_utils/__manifest__.py

@ -20,7 +20,7 @@
{
"name": "MuK Utils",
"summary": """Utility Features""",
"version": '11.0.1.0.8',
"version": '11.0.1.0.9',
"category": 'Extra Tools',
"license": "AGPL-3",
"website": "https://www.mukit.at",

9
muk_utils/models/res_users.py

@ -54,12 +54,12 @@ class ResUser(models.Model):
@api.multi
def write(self, vals):
group_ids = self.mapped('groups_id.id')
result = super(ResUser, self).write(vals)
group_ids += [vals[k] for k in vals if res_users.is_selection_groups(k) and vals[k]]
group_ids += [vals[k] for k in vals if res_users.is_boolean_group(k) and vals[k]]
vals = self._remove_reified_groups(vals)
if any(field in vals for field in ['groups_id']):
group_ids += self.mapped('groups_id.id')
group_ids = [command[1] for command in vals['groups_id'] if command[0] == 4 or command[0] == 3]
group_ids += [id for command in vals['groups_id'] if command[0] == 6 for id in command[2]]
group_ids = list(set(group_ids))
if group_ids:
model_recs = defaultdict(set)
model_names = self.pool.descendants(['muk_utils.groups'], '_inherit', '_inherits')
@ -82,4 +82,3 @@ class ResUser(models.Model):
result = super(ResUser, self).unlink()
for tuple in model_recs.items():
tuple[1].trigger_computation(['users'])
return result
Loading…
Cancel
Save