From 2a1754ff217b001546aca30b2ad479a030f574d0 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Thu, 26 Aug 2010 16:20:22 +0200 Subject: [PATCH] [FIX] base_action_rule: Use a flag on the object from the pool to disable the recursion issue bzr revid: stephane@openerp.com-20100826142022-9o0xyd3o3a30lsec --- addons/base_action_rule/base_action_rule.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 40eca6a254d..ff6321e599f 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -181,10 +181,12 @@ the rule to mark CC(mail to any other person defined in actions)."), for action_rule in self.browse(cr, uid, ids, context=context): model = action_rule.model_id.model obj_pool = self.pool.get(model) - obj_pool.__setattr__('create', self._create(obj_pool.create, model, context=context)) - obj_pool.__setattr__('write', self._write(obj_pool.write, model, context=context)) - return True + if not hasattr(obj_pool, 'base_action_ruled'): + obj_pool.create = self._create(obj_pool.create, model, context=context) + obj_pool.write = self._write(obj_pool.write, model, context=context) + obj_pool.base_action_ruled = True + return True def create(self, cr, uid, vals, context=None): res_id = super(base_action_rule, self).create(cr, uid, vals, context) self._register_hook(cr, uid, [res_id], context=context)