From 53abd98f118fa7a934157c15176ef9626d446b0c Mon Sep 17 00:00:00 2001 From: Henrik Norlin Date: Sun, 31 Mar 2024 10:43:53 +0200 Subject: [PATCH] [FIX] account_financial_report: report_action javascript --- .../static/src/js/report_action.esm.js | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/account_financial_report/static/src/js/report_action.esm.js b/account_financial_report/static/src/js/report_action.esm.js index f36a57cf19cb..2d9d4f42d63e 100644 --- a/account_financial_report/static/src/js/report_action.esm.js +++ b/account_financial_report/static/src/js/report_action.esm.js @@ -1,40 +1,40 @@ // /** @odoo-module **/ -// import {ReportAction} from "@web/webclient/actions/reports/report_action"; -// import { patch } from "@web/core/utils/patch"; -// import {useEnrichWithActionLinks} from "./report.esm"; +import {ReportAction} from "@web/webclient/actions/reports/report_action"; +import { patch } from "@web/core/utils/patch"; +import {useEnrichWithActionLinks} from "./report.esm"; -// const MODULE_NAME = "account_financial_report"; +const MODULE_NAME = "account_financial_report"; -// patch(ReportAction.prototype, "account_financial_report.ReportAction", { -// setup() { -// this._super.apply(this, arguments); -// this.isAccountFinancialReport = this.props.report_name.startsWith( -// `${MODULE_NAME}.` -// ); -// useEnrichWithActionLinks(this.iframe); -// }, +patch(ReportAction.prototype, { + setup() { + super.setup(...arguments); + this.isAccountFinancialReport = this.props.report_name.startsWith( + `${MODULE_NAME}.` + ); + useEnrichWithActionLinks(this.iframe); + }, -// export() { -// this.action.doAction({ -// type: "ir.actions.report", -// report_type: "xlsx", -// report_name: this._get_xlsx_name(this.props.report_name), -// report_file: this._get_xlsx_name(this.props.report_file), -// data: this.props.data || {}, -// context: this.props.context || {}, -// display_name: this.title, -// }); -// }, + export() { + this.action.doAction({ + type: "ir.actions.report", + report_type: "xlsx", + report_name: this._get_xlsx_name(this.props.report_name), + report_file: this._get_xlsx_name(this.props.report_file), + data: this.props.data || {}, + context: this.props.context || {}, + display_name: this.title, + }); + }, -// /** -// * @param {String} str -// * @returns {String} -// */ -// _get_xlsx_name(str) { -// if (!_.isString(str)) { -// return str; -// } -// const parts = str.split("."); -// return `a_f_r.report_${parts[parts.length - 1]}_xlsx`; -// }, -// }); + /** + * @param {String} str + * @returns {String} + */ + _get_xlsx_name(str) { + if (!_.isString(str)) { + return str; + } + const parts = str.split("."); + return `a_f_r.report_${parts[parts.length - 1]}_xlsx`; + }, +});