diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 86ce76cb6f9..76b4d7ee3ff 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -1562,12 +1562,9 @@ class BaseModel(object): # Check presence of __call__ directly instead of using # callable() because it will be deprecated as of Python 3.0 if hasattr(msg, '__call__'): - tmp_msg = msg(self, cr, uid, ids, context=context) - if isinstance(tmp_msg, tuple): - tmp_msg, params = tmp_msg - translated_msg = tmp_msg % params - else: - translated_msg = tmp_msg + translated_msg = msg(self, cr, uid, ids, context=context) + if isinstance(translated_msg, tuple): + translated_msg = translated_msg[0] % translated_msg[1] else: translated_msg = trans._get_source(cr, uid, self._name, 'constraint', lng, msg) if extra_error: