Browse Source

[FIX] Crash in base_user_role when role_id is not set on res.users.role.line

pull/897/head
Alexis de Lattre 8 years ago
committed by Jairo Llopis
parent
commit
b537941d5a
  1. 1
      base_user_role/models/user.py
  2. 2
      base_user_role/views/user.xml

1
base_user_role/models/user.py

@ -44,6 +44,7 @@ class ResUsers(models.Model):
lambda rec: rec.is_enabled) lambda rec: rec.is_enabled)
for role_line in role_lines: for role_line in role_lines:
role = role_line.role_id role = role_line.role_id
if role:
group_ids.append(role.group_id.id) group_ids.append(role.group_id.id)
group_ids.extend(role.implied_ids.ids) group_ids.extend(role.implied_ids.ids)
group_ids = list(set(group_ids)) # Remove duplicates IDs group_ids = list(set(group_ids)) # Remove duplicates IDs

2
base_user_role/views/user.xml

@ -12,7 +12,7 @@
<page string="Roles"> <page string="Roles">
<field name="role_line_ids" nolabel="1"> <field name="role_line_ids" nolabel="1">
<tree editable="bottom" colors="grey: not is_enabled;"> <tree editable="bottom" colors="grey: not is_enabled;">
<field name="role_id"/>
<field name="role_id" required="1"/>
<field name="date_from"/> <field name="date_from"/>
<field name="date_to"/> <field name="date_to"/>
<field name="is_enabled"/> <field name="is_enabled"/>

Loading…
Cancel
Save