简体   繁体   中英

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.

通过 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.

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

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'],
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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