Add missing reset caches on create and delete of group for issue1868
This commit is contained in:
1 parent
c5c449e1a0
commit
59da6cfd0c
1 file changed
+20
@@ -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()
|
||||
Reference in new issue
Block a user