From 376361c15c8d2be15a2579ffd0432f31d745deb8 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 2 Oct 2018 15:55:34 +0200 Subject: [PATCH] [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. --- addons/base_import/static/src/js/import_action.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/base_import/static/src/js/import_action.js b/addons/base_import/static/src/js/import_action.js index 6a17e25cb5b..c093987bc8e 100644 --- a/addons/base_import/static/src/js/import_action.js +++ b/addons/base_import/static/src/js/import_action.js @@ -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': [{