简体   繁体   English

如何在odoo V15中继承web.sign_name_and_signature

[英]How inherit web.sign_name_and_signature in odoo V15

I'm trying to inherit the signature module modal dialog to remove drawing and automatic options.我正在尝试继承签名模块模态对话框以删除绘图和自动选项。

But I can't do that because the model is deleted after loading in the web module.但我不能这样做,因为 model 在加载 web 模块后被删除。

通过 Odoo 加载文件

The sign_name_and_signature widget will load the xmlDependencies files in its willStart method, so the template will be ready when the rendering is performed. sign_name_and_signature小部件将在其willStart方法中加载xmlDependencies文件,因此模板将在执行渲染时准备就绪。

The template will be loaded just after initializing the widget, you can't use the template inheritance mechanism to alter the template but you can define a new template and inherit the NameAndSignature widget and change the XML dependencies to the new template file path模板会在widget初始化后加载,不能使用模板inheritance机制修改模板,可以定义新模板继承NameAndSignature widget,将XML依赖修改为新模板文件路径

Example:例子:

/** @odoo-module alias=MODULE_NAME.signature_dialog **/

import { NameAndSignature } from 'web.name_and_signature';

NameAndSignature.include({
    template: 'MODULE_NAME.sign_name_and_signature',
    xmlDependencies: ['/MODULE_NAME/static/src/xml/sign_name_and_signature.xml'],
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM