# Failed to write, log to messages, rollback savepoint (to
# avoid broken transaction) and keep going
cr.execute('ROLLBACK TO SAVEPOINT model_load_save')
+ except Exception, e:
+ message = (_('Unknown error during import:') +
+ u' %s: %s' % (type(e), unicode(e)))
+ 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,
+ # rollback savepoint and keep going
+ cr.execute('ROLLBACK TO SAVEPOINT model_load_save')
if any(message['type'] == 'error' for message in messages):
cr.execute('ROLLBACK TO SAVEPOINT model_load')
ids = False
self._transient_vacuum(cr, user)
self.check_access_rights(cr, user, 'create')
+
+ vals = self._add_missing_default_values(cr, user, vals, context)
if self._log_access:
for f in LOG_ACCESS_COLUMNS:
_logger.warning(
'Field `%s` is not allowed when creating the model `%s`.',
f, self._name)
- vals = self._add_missing_default_values(cr, user, vals, context)
tocreate = {}
for v in self._inherits: