diff --git a/account_statement_import/__manifest__.py b/account_statement_import/__manifest__.py index 706871b3..56ee15a9 100644 --- a/account_statement_import/__manifest__.py +++ b/account_statement_import/__manifest__.py @@ -22,4 +22,12 @@ "demo/partner_bank.xml", ], "installable": True, + "assets": { + "web.assets_backend": [ + "account_statement_import/static/src/js/account_dashboard_kanban.js", + ], + "web.assets_qweb": [ + "account_statement_import/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..5a0ba641 --- /dev/null +++ b/account_statement_import/static/src/js/account_dashboard_kanban.js @@ -0,0 +1,32 @@ +odoo.define("account_statement_import.dashboard.kanban", function (require) { + "use strict"; + + var viewRegistry = require("web.view_registry"); + var KanbanView = require("web.KanbanView"); + + var AccountDashboardView = viewRegistry.get("account_dashboard_kanban"); + // 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", + }); + }, + }); + AccountDashboardView = KanbanView.extend({ + config: _.extend({}, KanbanView.prototype.config, { + Controller: AccountDashboardController, + }), + }); + 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/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 new + + Import Statement + + + + +