From d32b8f4d3cc10f1ee92cef9f937b9e051feefcb0 Mon Sep 17 00:00:00 2001 From: Benjamin Willig Date: Fri, 11 Aug 2017 16:00:32 +0200 Subject: [PATCH] [10.0][FIX] User group not updating when removing a user from the role view --- 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 4635d11f2..0cc9f3900 100644 --- a/base_user_role/models/role.py +++ b/base_user_role/models/role.py @@ -85,3 +85,10 @@ class ResUsersRoleLine(models.Model): date_to = fields.Date.from_string(role_line.date_to) if today > date_to: role_line.is_enabled = False + + @api.multi + def unlink(self): + users = self.mapped('user_id') + res = super(ResUsersRoleLine, self).unlink() + users.set_groups_from_roles() + return res