From 75b987233b8488b33fdc95b752dd514c2aa08c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 31 Oct 2018 18:13:02 +0100 Subject: [PATCH] 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 --- trytond/ir/ui/menu.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trytond/ir/ui/menu.py b/trytond/ir/ui/menu.py index e3fdc5922e..df3120bec7 100644 --- a/trytond/ir/ui/menu.py +++ b/trytond/ir/ui/menu.py @@ -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)