[FIX] base: avoid generating invalid user group view

When no `base.module_category_user_type` Application is found, the group
view was generated with the domain `[('', '!=', <int>)]`, which is will
fail view validation.

This situation happen during database migration or if the module category
is deleted.
This commit is contained in:
Christophe Simonis
2018-09-12 19:05:29 +02:00
parent cd6e9ab4fb
commit d76cd50f0e
+4 -1
View File
@@ -885,7 +885,10 @@ class GroupsView(models.Model):
xml3.append(E.field(name=field_name, **attrs))
xml3.append({'class': "o_label_nowrap"})
user_type_attrs = {'invisible': [(user_type_field_name, '!=', group_employee.id)]}
if user_type_field_name:
user_type_attrs = {'invisible': [(user_type_field_name, '!=', group_employee.id)]}
else:
user_type_attrs = {}
xml = E.field(
E.group(*(xml1), col="2"),