forked from OCA/bank-statement-import
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
20 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 13 additions & 21 deletions
34
account_statement_import_file/static/src/js/account_dashboard_kanban.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,24 @@ | ||
odoo.define("account_statement_import_file.dashboard.kanban", function (require) { | ||
"use strict"; | ||
|
||
var viewRegistry = require("web.view_registry"); | ||
var KanbanView = require("web.KanbanView"); | ||
var KanbanView = require("@web/views/kanban/kanban_view"); | ||
var viewRegistry = require("@web/core/registry"); | ||
|
||
var AccountDashboardView = viewRegistry.get("account_dashboard_kanban"); | ||
// Value can be undefined on some test scenarios. Avoid an error by checking if it is defined | ||
var AccountDashboardView = viewRegistry.registry | ||
.category("views") | ||
.get("account_dashboard_kanban"); | ||
if (AccountDashboardView !== undefined) { | ||
var AccountDashboardController = | ||
AccountDashboardView.prototype.config.Controller; | ||
AccountDashboardController.include({ | ||
buttons_template: "AccountDashboardView.buttons", | ||
// We are reusing the create button | ||
_onButtonNew: function (ev) { | ||
AccountDashboardView.buttonTemplate = "AccountDashboardView.buttons"; | ||
Object.assign(KanbanView.kanbanView.Controller.prototype, { | ||
importOcaStatement: async function (ev) { | ||
ev.stopPropagation(); | ||
return this.trigger_up("do_action", { | ||
action: "account_statement_import_file.account_statement_import_action", | ||
return this.actionService.doAction({ | ||
type: "ir.actions.act_window", | ||
res_model: "account.statement.import", | ||
views: [[false, "form"]], | ||
target: "new", | ||
}); | ||
}, | ||
}); | ||
AccountDashboardView = KanbanView.extend({ | ||
config: _.extend({}, KanbanView.prototype.config, { | ||
Controller: AccountDashboardController, | ||
}), | ||
}); | ||
return { | ||
AccountDashboardView: AccountDashboardView, | ||
AccountDashboardController: AccountDashboardController, | ||
}; | ||
} | ||
}); |
9 changes: 5 additions & 4 deletions
9
account_statement_import_file/static/src/xml/account_dashboard_kanban.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters