From 701cafe2a529ae9ca53800822060f522c321e278 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 27 Jan 2009 00:19:05 +0100 Subject: [PATCH] bugfix_cache bzr revid: fp@tinyerp.com-20090126231905-9tzzkfouctynak8k --- bin/addons/base/ir/ir_model.py | 6 ++---- bin/addons/base/res/res_user.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py index 69729317471..e989808bb89 100644 --- a/bin/addons/base/ir/ir_model.py +++ b/bin/addons/base/ir/ir_model.py @@ -367,7 +367,8 @@ class ir_model_access(osv.osv): except ValueError: pass - def call_cache_clearing_methods(self): + def call_cache_clearing_methods(self, cr): + self.check.clear_cache(cr.dbname) # clear the cache of check function for model, method in self.__cache_clearing_methods: getattr(self.pool.get(model), method)() @@ -377,19 +378,16 @@ class ir_model_access(osv.osv): def write(self, cr, uid, *args, **argv): self.call_cache_clearing_methods() res = super(ir_model_access, self).write(cr, uid, *args, **argv) - self.check.clear_cache(cr.dbname) # clear the cache of check function return res def create(self, cr, uid, *args, **argv): self.call_cache_clearing_methods() res = super(ir_model_access, self).create(cr, uid, *args, **argv) - self.check.clear_cache(cr.dbname) # clear the cache of check function return res def unlink(self, cr, uid, *args, **argv): self.call_cache_clearing_methods() res = super(ir_model_access, self).unlink(cr, uid, *args, **argv) - self.check.clear_cache(cr.dbname) # clear the cache of check function return res ir_model_access() diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py index 6b36d43b854..7f2d49bdfbd 100644 --- a/bin/addons/base/res/res_user.py +++ b/bin/addons/base/res/res_user.py @@ -48,7 +48,7 @@ class groups(osv.osv): res = super(groups, self).write(cr, uid, ids, vals, context=context) # Restart the cache on the company_get method self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname) - self.pool.get('ir.model.access').call_cache_clearing_methods() + self.pool.get('ir.model.access').call_cache_clearing_methods(cr) return res def create(self, cr, uid, vals, context=None): @@ -168,7 +168,7 @@ class users(osv.osv): self.company_get.clear_cache(cr.dbname) # Restart the cache on the company_get method self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname) - self.pool.get('ir.model.access').call_cache_clearing_methods() + self.pool.get('ir.model.access').call_cache_clearing_methods(cr) return res def unlink(self, cr, uid, ids, context=None):