[FIX] models.py: log the full traceback when record import fails

Without the full stack trace, it is very hard for the developers to know
why and where the record creation has failed.

closes odoo/odoo#29143
This commit is contained in:
Richard Mathot
2018-11-29 15:12:59 +00:00
committed by Raphael Collet
parent 8a18ef0c5a
commit 1d553eea7b
+1
View File
@@ -893,6 +893,7 @@ class BaseModel(object):
# avoid broken transaction) and keep going
cr.execute('ROLLBACK TO SAVEPOINT model_load_save')
except Exception as e:
_logger.exception("Error while loading record")
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))