From 34b420304e3353edb1ed2bf24cb37f2255e361fb Mon Sep 17 00:00:00 2001 From: Albert Cervera i Areny Date: Mon, 28 Oct 2013 21:38:14 +0100 Subject: [PATCH] Add missing cache invalidations in res.group and res.user. issue3447 review1381002 --- trytond/res/group.py | 12 ++++++++++++ trytond/res/user.py | 2 ++ 2 files changed, 14 insertions(+) diff --git a/trytond/res/group.py b/trytond/res/group.py index 2d4ce47ac7..936a2355bd 100644 --- a/trytond/res/group.py +++ b/trytond/res/group.py @@ -82,6 +82,10 @@ class Group(ModelSQL, ModelView): pool.get('res.user')._get_groups_cache.clear() # Restart the cache for get_preferences pool.get('res.user')._get_preferences_cache.clear() + # Restart the cache for model access and view + pool.get('ir.model.access')._get_access_cache.clear() + pool.get('ir.model.field.access')._get_access_cache.clear() + ModelView._fields_view_get_cache.clear() return res @classmethod @@ -94,6 +98,10 @@ class Group(ModelSQL, ModelView): pool.get('res.user')._get_groups_cache.clear() # Restart the cache for get_preferences pool.get('res.user')._get_preferences_cache.clear() + # Restart the cache for model access and view + pool.get('ir.model.access')._get_access_cache.clear() + pool.get('ir.model.field.access')._get_access_cache.clear() + ModelView._fields_view_get_cache.clear() @classmethod def delete(cls, groups): @@ -105,6 +113,10 @@ class Group(ModelSQL, ModelView): pool.get('res.user')._get_groups_cache.clear() # Restart the cache for get_preferences pool.get('res.user')._get_preferences_cache.clear() + # Restart the cache for model access and view + pool.get('ir.model.access')._get_access_cache.clear() + pool.get('ir.model.field.access')._get_access_cache.clear() + ModelView._fields_view_get_cache.clear() class Group2: diff --git a/trytond/res/user.py b/trytond/res/user.py index e50c8fd9db..102ba48718 100644 --- a/trytond/res/user.py +++ b/trytond/res/user.py @@ -240,6 +240,8 @@ class User(ModelSQL, ModelView): cls._get_preferences_cache.clear() # Restart the cache of check pool.get('ir.model.access')._get_access_cache.clear() + # Restart the cache of check + pool.get('ir.model.field.access')._get_access_cache.clear() # Restart the cache ModelView._fields_view_get_cache.clear()