Re-browse the filtered menus

It is needed to avoid access right errors when filtered records are access
because they share the same local cache.

issue7806
review45771002
This commit is contained in:
Cédric Krier committed 2018-10-31 18:13:02 +01:00
1 parent 8be4976700
commit 75b987233b
1 file changed
+3 -2
+3 -2
View File
@@ -147,8 +147,9 @@ class UIMenu(DeactivableMixin, sequence_ordered(), tree(separator=' / '),
parents.update(cls.search([
('id', 'in', list(sub_parent_ids)),
]))
menus = [x for x in menus
if (x.parent and x.parent in parents) or not x.parent]
# Re-browse to avoid side-cache access
menus = cls.browse([x.id for x in menus
if (x.parent and x.parent in parents) or not x.parent])
if count:
return len(menus)