ODOO15 中的覆盖功能
随着odoo15的新变化。我无法覆盖 Javascript 中的函数。我创建了一个自定义模块并导入了所需的模块。
我想重写 _executeReportAction 函数
import {download} from "@web/core/network/download";
import {registry} from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import {actionService} from "@web/webclient/actions/action_service";
async function _executeReportAction(action, options) {
}
,那么该怎么做
With the new changes in odoo15. I am not able to override a function in Javascript. I have created a custom module and imported the required.
I want to override _executeReportAction function
import {download} from "@web/core/network/download";
import {registry} from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import {actionService} from "@web/webclient/actions/action_service";
async function _executeReportAction(action, options) {
}
so how to do it
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
_executeReportAction
函数将首先尝试执行 ir.actions.report 处理程序,因此不要修补函数,而是添加zpl
报告处理程序。您可以检查 OCA report_xlsx 模块,为
xlsx
报告定义报告处理程序原始代码:
在上面的代码中,他们合并了 _triggerDownload 和 _getReportUrl 函数成一个函数。
The
_executeReportAction
function will first try to execute ir.actions.report handlers, so instead of patching the function add azpl
report handler.You can check the OCA report_xlsx module which defines a report handler for
xlsx
reportsOriginal Code:
In the code above they merged the _triggerDownload and _getReportUrl functions into one function.