From c83d4b5724ad113625db1b1a537fa35f4e686fda Mon Sep 17 00:00:00 2001 From: sebalix Date: Thu, 21 Sep 2017 11:21:34 +0200 Subject: [PATCH] [FIX] base_user_role: update users' groups when a role is deleted --- base_user_role/models/role.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/base_user_role/models/role.py b/base_user_role/models/role.py index a86f67263..96c874143 100644 --- a/base_user_role/models/role.py +++ b/base_user_role/models/role.py @@ -48,6 +48,13 @@ class ResUsersRole(models.Model): self.update_users() 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 def update_users(self): """Update all the users concerned by the roles identified by `ids`."""