[IMP] account_statment_import: Add button for importing on top

This commit is contained in:
Enric Tobella
2022-11-17 16:40:16 +01:00
parent 963af07c93
commit 36fe2985e5
5 changed files with 56 additions and 0 deletions

View File

@@ -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,
};
});

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<template>
<t t-name="AccountDashboardView.buttons">
<div>
<button
type="button"
t-attf-class="btn #{btnClass} o-kanban-button-new"
accesskey="c"
>
<t t-esc="_t('Import Statement (OCA)')" />
</button>
</div>
</t>
</template>