From 9633423bccf28003a7f0785fbf7b67a96372355d Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 29 Jan 2010 10:38:46 +0100 Subject: [PATCH] [FIX] Disable the cache for the ir.rules lp bug: https://launchpad.net/bugs/372747 fixed bzr revid: stephane@openerp.com-20100129093846-b1hbz5as9p4olvv4 --- bin/addons/base/ir/ir_rule.py | 39 ------------------------------ bin/addons/base/res/res_company.py | 1 - bin/addons/base/res/res_user.py | 2 -- 3 files changed, 42 deletions(-) diff --git a/bin/addons/base/ir/ir_rule.py b/bin/addons/base/ir/ir_rule.py index 7e5a2d05155..0eea6a11369 100644 --- a/bin/addons/base/ir/ir_rule.py +++ b/bin/addons/base/ir/ir_rule.py @@ -43,24 +43,6 @@ class ir_rule_group(osv.osv): 'global': lambda *a: True, } - def unlink(self, cr, uid, ids, context=None): - res = super(ir_rule_group, self).unlink(cr, uid, ids, context=context) - # Restart the cache on the domain_get method of ir.rule - self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname) - return res - - def create(self, cr, user, vals, context=None): - res = super(ir_rule_group, self).create(cr, user, vals, context=context) - # Restart the cache on the domain_get method of ir.rule - self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname) - return res - - def write(self, cr, uid, ids, vals, context=None): - res = super(ir_rule_group, self).write(cr, uid, ids, vals, context=context) - # Restart the cache on the domain_get method of ir.rule - self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname) - return res - ir_rule_group() @@ -210,27 +192,6 @@ class ir_rule(osv.osv): if query: query = '('+query+')' return query, val - domain_get = tools.cache()(domain_get) - - def unlink(self, cr, uid, ids, context=None): - res = super(ir_rule, self).unlink(cr, uid, ids, context=context) - # Restart the cache on the domain_get method of ir.rule - self.domain_get.clear_cache(cr.dbname) - return res - - def create(self, cr, user, vals, context=None): - res = super(ir_rule, self).create(cr, user, vals, context=context) - # Restart the cache on the domain_get method of ir.rule - self.domain_get.clear_cache(cr.dbname) - return res - - def write(self, cr, uid, ids, vals, context=None): - if not context: - context={} - res = super(ir_rule, self).write(cr, uid, ids, vals, context=context) - # Restart the cache on the domain_get method - self.domain_get.clear_cache(cr.dbname) - return res ir_rule() diff --git a/bin/addons/base/res/res_company.py b/bin/addons/base/res/res_company.py index 2158035abb3..87c81f95e09 100644 --- a/bin/addons/base/res/res_company.py +++ b/bin/addons/base/res/res_company.py @@ -82,7 +82,6 @@ class res_company(osv.osv): def write(self, cr, *args, **argv): self.cache_restart(cr) # Restart the cache on the company_get method - self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname) return super(res_company, self).write(cr, *args, **argv) def _get_euro(self, cr, uid, context={}): diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py index da36c0d7555..a3c3923d17c 100644 --- a/bin/addons/base/res/res_user.py +++ b/bin/addons/base/res/res_user.py @@ -48,7 +48,6 @@ class groups(osv.osv): _('The name of the group can not start with "-"')) 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(cr) return res @@ -185,7 +184,6 @@ class users(osv.osv): res = super(users, self).write(cr, uid, ids, values, *args, **argv) 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(cr) return res