[FIX] base_import: show error message in some situation where it was missing

On an AccessError, the relevant message is passed as the first arg. But
the import error handler would only check for the second arg (if any)
then fallback on error.message, which is missing entirely when the issue
is raised as an except_orm subclass.
This commit is contained in:
Xavier Morel
2018-10-03 16:54:25 +02:00
committed by Olivier Dony
parent 5141f42d0e
commit 376361c15c
@@ -582,7 +582,8 @@ var DataImport = AbstractAction.extend(ControlPanelMixin, {
msg = _t("An unknown issue occurred during import (possibly lost connection, data limit exceeded or memory limits exceeded). Please retry in case the issue is transient. If the issue still occurs, try to split the file rather than import it at once.");
}
} else {
msg = error.data.arguments ? error.data.arguments[1] : error.message;
msg = (error.data.arguments && error.data.arguments[1] || error.data.arguments[0])
|| error.message;
}
return $.when({'messages': [{