summaryrefslogtreecommitdiff
path: root/odoo/models.py
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2017-08-18 10:06:31 +0200
committerMartin Trigaux <mat@odoo.com>2017-08-18 11:12:16 +0200
commitcf8985e37d48ead868c83a4589b2f755f57de379 (patch)
treefd10a9c6d839a9a9d306b66665774cf1945c877a /odoo/models.py
parentc00267bc340090142ed6c8d62485a6825c657d1b (diff)
[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
Diffstat (limited to 'odoo/models.py')
-rw-r--r--odoo/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/models.py b/odoo/models.py
index f58ed393eb2..802a97d0304 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -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,