diff --git a/trytond/trytond/ir/action.py b/trytond/trytond/ir/action.py index c8cead88dd..3d83cc976c 100644 --- a/trytond/trytond/ir/action.py +++ b/trytond/trytond/ir/action.py @@ -226,14 +226,12 @@ class ActionKeyword(ModelSQL, ModelView): @classmethod def delete(cls, keywords): - ModelView._fields_view_get_cache.clear() ModelView._view_toolbar_get_cache.clear() cls._get_keyword_cache.clear() super(ActionKeyword, cls).delete(keywords) @classmethod def create(cls, vlist): - ModelView._fields_view_get_cache.clear() ModelView._view_toolbar_get_cache.clear() cls._get_keyword_cache.clear() new_vlist = [] @@ -248,7 +246,6 @@ class ActionKeyword(ModelSQL, ModelView): for keywords, values in zip(actions, actions): args.extend((keywords, cls._convert_vals(values))) super(ActionKeyword, cls).write(*args) - ModelView._fields_view_get_cache.clear() ModelView._view_toolbar_get_cache.clear() cls._get_keyword_cache.clear() @@ -390,7 +387,6 @@ class ActionMixin(ModelSQL): @classmethod def create(cls, vlist): pool = Pool() - ModelView._fields_view_get_cache.clear() ModelView._view_toolbar_get_cache.clear() Action = pool.get('ir.action') ir_action = cls.__table__() @@ -435,14 +431,12 @@ class ActionMixin(ModelSQL): pool = Pool() ActionKeyword = pool.get('ir.action.keyword') super(ActionMixin, cls).write(records, values, *args) - ModelView._fields_view_get_cache.clear() ModelView._view_toolbar_get_cache.clear() ActionKeyword._get_keyword_cache.clear() @classmethod def delete(cls, records): pool = Pool() - ModelView._fields_view_get_cache.clear() ModelView._view_toolbar_get_cache.clear() Action = pool.get('ir.action') actions = [x.action for x in records] diff --git a/trytond/trytond/model/modelview.py b/trytond/trytond/model/modelview.py index 85eebc0f21..947f0d14b4 100644 --- a/trytond/trytond/model/modelview.py +++ b/trytond/trytond/model/modelview.py @@ -226,7 +226,10 @@ class ModelView(Model): - fields: a dictionary with the definition of each field in the view - field_childs: the name of the childs field for tree ''' - key = (cls.__name__, view_id, view_type, level) + pool = Pool() + User = pool.get('res.user') + + key = (User.get_groups(), cls.__name__, view_id, view_type, level) result = cls._fields_view_get_cache.get(key) if result: return result diff --git a/trytond/trytond/res/group.py b/trytond/trytond/res/group.py index e4e03a63cb..d44a392bf2 100644 --- a/trytond/trytond/res/group.py +++ b/trytond/trytond/res/group.py @@ -64,8 +64,6 @@ class Group(DeactivableMixin, tree(), ModelSQL, ModelView): pool = Pool() # Restart the cache for get_groups pool.get('res.user')._get_groups_cache.clear() - # Restart the cache for view - ModelView._fields_view_get_cache.clear() @classmethod def copy(cls, groups, default=None): diff --git a/trytond/trytond/res/user.py b/trytond/trytond/res/user.py index 96baf4e954..5fccb0082e 100644 --- a/trytond/trytond/res/user.py +++ b/trytond/trytond/res/user.py @@ -414,8 +414,6 @@ class User(avatar_mixin(100, 'login'), DeactivableMixin, ModelSQL, ModelView): if cls.__name__ in cache: for user in all_users: cache[cls.__name__].pop(user.id, None) - # Restart the cache - ModelView._fields_view_get_cache.clear() @classmethod def delete(cls, users): @@ -1017,8 +1015,6 @@ class UserGroup(ModelSQL): pool = Pool() # Restart the cache for get_groups pool.get('res.user')._get_groups_cache.clear() - # Restart the cache for view - ModelView._fields_view_get_cache.clear() return records @classmethod @@ -1027,8 +1023,6 @@ class UserGroup(ModelSQL): pool = Pool() # Restart the cache for get_groups pool.get('res.user')._get_groups_cache.clear() - # Restart the cache for view - ModelView._fields_view_get_cache.clear() @classmethod def delete(cls, groups): @@ -1036,8 +1030,6 @@ class UserGroup(ModelSQL): pool = Pool() # Restart the cache for get_groups pool.get('res.user')._get_groups_cache.clear() - # Restart the cache for view - ModelView._fields_view_get_cache.clear() @classmethod def user_group_all_table(cls):