[FIX] base_action_rule: missing context = {} initialization.

bzr revid: vmt@openerp.com-20111222141018-u6by4ht7x4zvvxts
This commit is contained in:
Vo Minh Thu 2011-12-22 15:10:18 +01:00
parent 41c2ffb480
commit 20dd20447e
1 changed files with 4 additions and 0 deletions

View File

@ -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)