From 36fe2985e54b2da5cd5abbcc6fccecf35e17cb03 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Thu, 17 Nov 2022 16:40:16 +0100 Subject: [PATCH] [IMP] account_statment_import: Add button for importing on top --- account_statement_import/__manifest__.py | 2 ++ .../static/src/js/account_dashboard_kanban.js | 21 +++++++++++++++++++ .../src/xml/account_dashboard_kanban.xml | 14 +++++++++++++ account_statement_import/templates/assets.xml | 11 ++++++++++ .../wizard/account_statement_import_view.xml | 8 +++++++ 5 files changed, 56 insertions(+) create mode 100644 account_statement_import/static/src/js/account_dashboard_kanban.js create mode 100644 account_statement_import/static/src/xml/account_dashboard_kanban.xml create mode 100644 account_statement_import/templates/assets.xml diff --git a/account_statement_import/__manifest__.py b/account_statement_import/__manifest__.py index 8fac8811..7556e06d 100644 --- a/account_statement_import/__manifest__.py +++ b/account_statement_import/__manifest__.py @@ -17,9 +17,11 @@ "security/ir.model.access.csv", "wizard/account_statement_import_view.xml", "views/account_journal.xml", + "templates/assets.xml", ], "demo": [ "demo/partner_bank.xml", ], "installable": True, + "qweb": ["static/src/xml/account_dashboard_kanban.xml"], } diff --git a/account_statement_import/static/src/js/account_dashboard_kanban.js b/account_statement_import/static/src/js/account_dashboard_kanban.js new file mode 100644 index 00000000..f835ad7b --- /dev/null +++ b/account_statement_import/static/src/js/account_dashboard_kanban.js @@ -0,0 +1,21 @@ +odoo.define("account_statement_import.dashboard.kanban", function (require) { + "use strict"; + 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, + }; +}); diff --git a/account_statement_import/static/src/xml/account_dashboard_kanban.xml b/account_statement_import/static/src/xml/account_dashboard_kanban.xml new file mode 100644 index 00000000..7a4cdfd2 --- /dev/null +++ b/account_statement_import/static/src/xml/account_dashboard_kanban.xml @@ -0,0 +1,14 @@ + + diff --git a/account_statement_import/templates/assets.xml b/account_statement_import/templates/assets.xml new file mode 100644 index 00000000..ae901090 --- /dev/null +++ b/account_statement_import/templates/assets.xml @@ -0,0 +1,11 @@ + + +