diff --git a/base_user_role/models/user.py b/base_user_role/models/user.py index 30f807116..0a160a495 100644 --- a/base_user_role/models/user.py +++ b/base_user_role/models/user.py @@ -44,8 +44,9 @@ class ResUsers(models.Model): lambda rec: rec.is_enabled) for role_line in role_lines: role = role_line.role_id - group_ids.append(role.group_id.id) - group_ids.extend(role.implied_ids.ids) + if role: + group_ids.append(role.group_id.id) + group_ids.extend(role.implied_ids.ids) group_ids = list(set(group_ids)) # Remove duplicates IDs vals = { 'groups_id': [(6, 0, group_ids)], diff --git a/base_user_role/views/user.xml b/base_user_role/views/user.xml index d8da77915..4319940e9 100644 --- a/base_user_role/views/user.xml +++ b/base_user_role/views/user.xml @@ -12,7 +12,7 @@ - +