[FIX] models: properly format load error
In case of foreign language, using unicode characters, the error message may be badly formated. e.g. Unknown error during import: <class 'odoo.exceptions.AccessError'>: เฉพาะผู้ดูแลร.. insted of Unknown error during import: <class 'odoo.exceptions.AccessError'>: (u'\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e1c\u0e39 opw-766580
This commit is contained in:
+1
-1
@@ -895,7 +895,7 @@ class BaseModel(object):
|
||||
# avoid broken transaction) and keep going
|
||||
cr.execute('ROLLBACK TO SAVEPOINT model_load_save')
|
||||
except Exception as e:
|
||||
message = (_('Unknown error during import:') + ' %s: %s' % (type(e), unicode(e)))
|
||||
message = (_('Unknown error during import:') + ' %s: %s' % (type(e), unicode(e.message or e.name)))
|
||||
moreinfo = _('Resolve other errors first')
|
||||
messages.append(dict(info, type='error', message=message, moreinfo=moreinfo))
|
||||
# Failed for some reason, perhaps due to invalid data supplied,
|
||||
|
||||
Reference in New Issue
Block a user