From 59da6cfd0cb9534a9bf3587ecd0090ef3721eef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 28 Feb 2011 12:03:48 +0100 Subject: [PATCH] Add missing reset caches on create and delete of group for issue1868 --- trytond/res/group.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/trytond/res/group.py b/trytond/res/group.py index 0c22e12686..01eef03519 100644 --- a/trytond/res/group.py +++ b/trytond/res/group.py @@ -23,6 +23,16 @@ class Group(ModelSQL, ModelView): ('name_uniq', 'unique (name)', 'The name of the group must be unique!') ] + def create(self, vals): + res = super(Group, self).create(vals) + # Restart the cache on the domain_get method + self.pool.get('ir.rule').domain_get.reset() + # Restart the cache for get_groups + self.pool.get('res.user').get_groups.reset() + # Restart the cache for get_preferences + self.pool.get('res.user').get_preferences.reset() + return res + def write(self, ids, vals): res = super(Group, self).write(ids, vals) # Restart the cache on the domain_get method @@ -33,4 +43,14 @@ class Group(ModelSQL, ModelView): self.pool.get('res.user').get_preferences.reset() return res + def delete(self, ids): + res = super(Group, self).delete(ids) + # Restart the cache on the domain_get method + self.pool.get('ir.rule').domain_get.reset() + # Restart the cache for get_groups + self.pool.get('res.user').get_groups.reset() + # Restart the cache for get_preferences + self.pool.get('res.user').get_preferences.reset() + return res + Group()