From 7fda03b1d21604bac9656d9611ef9bc037525297 Mon Sep 17 00:00:00 2001 From: ced <> Date: Mon, 23 Jul 2007 05:16:18 +0000 Subject: [PATCH] base: add flush rule cache when write rule group bzr revid: ced-f244ec7f8a11e71f97e9cd4c71f8fb22abb6b5a9 --- bin/addons/base/ir/ir_rule.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/bin/addons/base/ir/ir_rule.py b/bin/addons/base/ir/ir_rule.py index 56fa2fb0b85..cf8a19cedbf 100644 --- a/bin/addons/base/ir/ir_rule.py +++ b/bin/addons/base/ir/ir_rule.py @@ -46,6 +46,15 @@ class ir_rule_group(osv.osv): _defaults={ 'global': lambda *a: True, } + + def write(self, cr, uid, ids, vals, context=None): + if not context: + context={} + res = super(ir_rule_group, self).write(cr, uid, ids, vals, context) + # Restart the cache on the domain_get method of ir.rule + self.pool.get('ir.rule').domain_get() + return res + ir_rule_group() @@ -136,9 +145,11 @@ class ir_rule(osv.osv): return query, val domain_get = tools.cache()(domain_get) - def write(self, cr, uid, *args, **argv): - res = super(ir_rule, self).write(cr, uid, *args, **argv) - # Restart the cache on the company_get method + def write(self, cr, uid, ids, vals, context=None): + if not context: + context={} + res = super(ir_rule, self).write(cr, uid, ids, vals, context) + # Restart the cache on the domain_get method self.domain_get() return res