[FIX] orm.import_data: also translate SQL constraints error messages that are not callable
bzr revid: odo@openerp.com-20101124172819-33ahiq3aacgwt8f2
This commit is contained in:
parent
03f3100346
commit
475667d384
|
@ -982,6 +982,8 @@ class orm_template(object):
|
|||
msg = self.pool._sql_error[key]
|
||||
if hasattr(msg, '__call__'):
|
||||
msg = msg(cr, uid, [res_id,], context=context)
|
||||
else:
|
||||
msg = _(msg)
|
||||
break
|
||||
return (-1, res, 'Line ' + str(counter) +' : ' + msg, '')
|
||||
if isinstance(e, osv.orm.except_orm):
|
||||
|
|
Loading…
Reference in New Issue