[MIG] account_financial_report: Migration to 15.0
This commit is contained in:
@@ -1,35 +1,37 @@
|
||||
odoo.define("account_financial_report.ReportActionManager", function (require) {
|
||||
"use strict";
|
||||
|
||||
const ActionManager = require("web.ActionManager");
|
||||
require("web.ReportActionManager");
|
||||
|
||||
ActionManager.include({
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
_executeReportClientAction: function (action, options) {
|
||||
const MODULE_NAME = "account_financial_report";
|
||||
|
||||
// When 'report_action' is called from the backend, Odoo hardcodes the action tag.
|
||||
// We have to make a hack to use our own report controller.
|
||||
if (action.report_name.startsWith(`${MODULE_NAME}.`)) {
|
||||
const urls = this._makeReportUrls(action);
|
||||
const clientActionOptions = _.extend({}, options, {
|
||||
context: action.context,
|
||||
data: action.data,
|
||||
display_name: action.display_name,
|
||||
name: action.name,
|
||||
report_file: action.report_file,
|
||||
report_name: action.report_name,
|
||||
report_url: urls.html,
|
||||
});
|
||||
return this.doAction(
|
||||
"account_financial_report.client_action",
|
||||
clientActionOptions
|
||||
);
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
});
|
||||
// Method is available here https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/webclient/actions/action_service.js#L981
|
||||
// TO DO: Check for implement this action inherit
|
||||
// odoo.define("account_financial_report.ReportActionManager", function (require) {
|
||||
// "use strict";
|
||||
//
|
||||
// const ActionManager = require("web.ActionManager");
|
||||
// require("web.ReportActionManager");
|
||||
//
|
||||
// ActionManager.include({
|
||||
// /**
|
||||
// * @override
|
||||
// */
|
||||
// _executeReportClientAction: function (action, options) {
|
||||
// const MODULE_NAME = "account_financial_report";
|
||||
//
|
||||
// // When 'report_action' is called from the backend, Odoo hardcodes the action tag.
|
||||
// // We have to make a hack to use our own report controller.
|
||||
// if (action.report_name.startsWith(`${MODULE_NAME}.`)) {
|
||||
// const urls = this._makeReportUrls(action);
|
||||
// const clientActionOptions = _.extend({}, options, {
|
||||
// context: action.context,
|
||||
// data: action.data,
|
||||
// display_name: action.display_name,
|
||||
// name: action.name,
|
||||
// report_file: action.report_file,
|
||||
// report_name: action.report_name,
|
||||
// report_url: urls.html,
|
||||
// });
|
||||
// return this.doAction(
|
||||
// "account_financial_report.client_action",
|
||||
// clientActionOptions
|
||||
// );
|
||||
// }
|
||||
// return this._super.apply(this, arguments);
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
|
||||
Reference in New Issue
Block a user