Skip to content

Commit

Permalink
[16.0][MIG] portforward OCA#522,OCA#527 to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sonhd91 committed Dec 15, 2022
1 parent 8cfe9ad commit c4feab7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 30 deletions.
5 changes: 1 addition & 4 deletions account_statement_import_file/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
"installable": True,
"assets": {
"web.assets_backend": [
"account_statement_import_file/static/src/js/account_dashboard_kanban.js",
],
"web.assets_qweb": [
"account_statement_import_file/static/src/xml/account_dashboard_kanban.xml"
"account_statement_import_file/static/src/**/*",
],
},
}
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,
};
}
});
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<template>
<t t-name="AccountDashboardView.buttons">
<template xml:space="preserve">
<t t-name="AccountDashboardView.buttons" owl='1'>
<div>
<button
type="button"
t-attf-class="btn #{btnClass} o-kanban-button-new"
class="btn btn-primary o-kanban-button-new"
accesskey="c"
t-on-click="(ev) => this.importOcaStatement(ev)"
>
<t t-esc="_t('Import Statement (OCA)')" />
Import Statement (OCA)
</button>
</div>
</t>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def _update_partner_from_account_number(self, lvals):
def _complete_stmts_vals(self, stmts_vals, journal, account_number):
for st_vals in stmts_vals:
for lvals in st_vals["transactions"]:
lvals['journal_id'] = journal.id
lvals["journal_id"] = journal.id
unique_import_id = lvals.get("unique_import_id")
if unique_import_id:
sanitized_account_number = sanitize_account_number(account_number)
Expand Down

0 comments on commit c4feab7

Please sign in to comment.