[FIX] base: Always call '_update_user_groups_view' when updating a res_group

Since abdca55ea2, the call to '_update_user_groups_view' if made only if the category_id is modified on a res_group. This method is re-computing the xml for the group_ids on res_user form view. This modification is wrong because:

- If the name or the share fields are modified too, the view should be recomputed too.
- It introduce a bug which is the following. When creating a new instance with no demo data, the method is not called and the group_ids field is still displayed as a one2many of the res_groups instead of the prettier way to display the information we're used to.
This commit is contained in:
Yannick Tivisse
2016-08-24 11:51:15 +02:00
parent bc1a0a32ca
commit 0460299549
+1 -2
View File
@@ -678,8 +678,7 @@ class GroupsView(models.Model):
@api.multi
def write(self, values):
res = super(GroupsView, self).write(values)
if 'category_id' in values:
self._update_user_groups_view()
self._update_user_groups_view()
# ir_values.get_actions() depends on action records
self.env['ir.values'].clear_caches()
return res