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)