Browse Source

[FIX] base_user_role: update users' groups when a role is deleted

pull/922/head
sebalix 7 years ago
parent
commit
c83d4b5724
  1. 7
      base_user_role/models/role.py

7
base_user_role/models/role.py

@ -48,6 +48,13 @@ class ResUsersRole(models.Model):
self.update_users() self.update_users()
return res return res
@api.multi
def unlink(self):
users = self.mapped('user_id')
res = super(ResUsersRole, self).unlink()
users.set_groups_from_roles()
return res
@api.multi @api.multi
def update_users(self): def update_users(self):
"""Update all the users concerned by the roles identified by `ids`.""" """Update all the users concerned by the roles identified by `ids`."""

Loading…
Cancel
Save