From 30978180c4976edb5dd8e5ecd543526261af4a0f Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Mon, 28 Nov 2022 14:18:52 +0100 Subject: [PATCH 1/2] [FIX] account_statement_import: Do not load JS on some test environment --- .../static/src/js/account_dashboard_kanban.js | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/account_statement_import/static/src/js/account_dashboard_kanban.js b/account_statement_import/static/src/js/account_dashboard_kanban.js index f835ad7b..b45327e2 100644 --- a/account_statement_import/static/src/js/account_dashboard_kanban.js +++ b/account_statement_import/static/src/js/account_dashboard_kanban.js @@ -3,19 +3,23 @@ odoo.define("account_statement_import.dashboard.kanban", function (require) { var viewRegistry = require("web.view_registry"); var AccountDashboardView = viewRegistry.get("account_dashboard_kanban"); - var AccountDashboardController = AccountDashboardView.prototype.config.Controller; - AccountDashboardController.include({ - buttons_template: "AccountDashboardView.buttons", - // We are reusing the create button - _onButtonNew: function (ev) { - ev.stopPropagation(); - return this.trigger_up("do_action", { - action: "account_statement_import.account_statement_import_action", - }); - }, - }); - return { - AccountDashboardView: AccountDashboardView, - AccountDashboardController: AccountDashboardController, - }; + // Value can be undefined on some test scenarios. Avoid an error by checking if it is defined + if (AccountDashboardView !== undefined) { + var AccountDashboardController = + AccountDashboardView.prototype.config.Controller; + AccountDashboardController.include({ + buttons_template: "AccountDashboardView.buttons", + // We are reusing the create button + _onButtonNew: function (ev) { + ev.stopPropagation(); + return this.trigger_up("do_action", { + action: "account_statement_import.account_statement_import_action", + }); + }, + }); + return { + AccountDashboardView: AccountDashboardView, + AccountDashboardController: AccountDashboardController, + }; + } }); From 817f7fb4df25125f3fbf5aac147a9ebd98898c57 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Mon, 28 Nov 2022 14:19:07 +0100 Subject: [PATCH 2/2] [FIX] account_Statement_import: Show button on header --- account_statement_import/views/account_journal.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/account_statement_import/views/account_journal.xml b/account_statement_import/views/account_journal.xml index 952a3364..1f81b2ec 100644 --- a/account_statement_import/views/account_journal.xml +++ b/account_statement_import/views/account_journal.xml @@ -11,6 +11,13 @@ account.journal + + + 1 + or