From b537941d5a2d1fcb3fbacc602124c1b3f6e1d495 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 12 Jun 2017 23:14:11 +0200 Subject: [PATCH] [FIX] Crash in base_user_role when role_id is not set on res.users.role.line --- base_user_role/models/user.py | 5 +++-- base_user_role/views/user.xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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 @@ - +