[IMP]base_action_rule : Improve the code

bzr revid: dbr@tinyerp.com-20110804073052-p9zrcaq9i71jopux
This commit is contained in:
DBR (OpenERP) 2011-08-04 13:00:52 +05:30
parent ef47e5d498
commit 238cd085bb
1 changed files with 2 additions and 4 deletions

View File

@ -176,17 +176,15 @@ the rule to mark CC(mail to any other person defined in actions)."),
return make_call_old
def _write(self, old_write, model, context=None):
if context is None:
context = {}
def make_call_old(cr, uid, ids, vals, context=context):
if context is None:
context = {}
if isinstance(ids, (str, int, long)):
ids = [ids]
id = old_write(cr, uid, ids, vals, context=context)
change_id = old_write(cr, uid, ids, vals, context=context)
if not context.get('action'):
self.pre_action(cr, uid, ids, model, context=context)
return id
return change_id
return make_call_old
def _register_hook(self, cr, uid, ids, context=None):