From 20dd20447e8a47d34e7060499893660b2ea93b1a Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Thu, 22 Dec 2011 15:10:18 +0100 Subject: [PATCH] [FIX] base_action_rule: missing context = {} initialization. bzr revid: vmt@openerp.com-20111222141018-u6by4ht7x4zvvxts --- addons/base_action_rule/base_action_rule.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 2d239adada2..51661f9eb00 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -171,6 +171,8 @@ the rule to mark CC(mail to any other person defined in actions)."), `post_action`, in that order. """ def wrapper(cr, uid, vals, context=context): + if context is None: + context = {} new_id = old_create(cr, uid, vals, context=context) if not context.get('action'): self.post_action(cr, uid, [new_id], model, context=context) @@ -183,6 +185,8 @@ the rule to mark CC(mail to any other person defined in actions)."), `post_action`, in that order. """ def wrapper(cr, uid, ids, vals, context=context): + if context is None: + context = {} if isinstance(ids, (str, int, long)): ids = [ids] old_write(cr, uid, ids, vals, context=context)