[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:
Olivier Dony 2010-11-24 18:28:19 +01:00
parent 03f3100346
commit 475667d384
1 changed files with 2 additions and 0 deletions

View File

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