Browse Source

Merge pull request #934 from acsone/10.0-res_users_group_update-bwi

[10.0][FIX] User group not updating when removing a user from the role view
pull/936/merge
Stéphane Bidoul (ACSONE) 7 years ago
committed by GitHub
parent
commit
f330e78fd4
  1. 7
      base_user_role/models/role.py

7
base_user_role/models/role.py

@ -85,3 +85,10 @@ class ResUsersRoleLine(models.Model):
date_to = fields.Date.from_string(role_line.date_to) date_to = fields.Date.from_string(role_line.date_to)
if today > date_to: if today > date_to:
role_line.is_enabled = False 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
Loading…
Cancel
Save