如何解决为什么我不能从发票邮件模板更新 body_html?
所以我被要求从发票邮件模板中更改 body_html。我一直通过数据xml文件对这个模型进行更改,所以我像往常一样这样做:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module','=','account'),('name','email_template_edi_invoice')]"/>
</function>
<value eval="{'noupdate': False}"/>
</function>
<record id="account.email_template_edi_invoice" model="mail.template">
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Dear ${object.approver.name}
<br /><br />
We need your aprobation for ${object.name},fromn ${object.company_id.name}
<br /><br />
Please,check before everything is in order.
</p>
</div>
</field>
</record>
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module','email_template_edi_invoice')]"/>
</function>
<value eval="{'noupdate': True}"/>
</function>
</odoo>
在实际更改前后,我已将 'noupdate' 值更新为 False,以便应用更改,然后又恢复为 True。这是因为来自 account 模块的原始模板具有 标签。
升级我的自定义模块后,模板正文没有改变。我决定尝试更改名称值,所以我把它放在我的文件中: (为了使它更简单,我跳过了 noupdate 更改)
<record id="account.email_template_edi_invoice" model="mail.template">
<field name="name">Invoice: Send by email (testing if this changes)</field> <!-- Here I put this to check if it changes -->
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Dear ${object.approver.name}
<br /><br />
We need your aprobation for ${object.name},fromn ${object.company_id.name}
<br /><br />
Please,check before everything is in order.
</p>
</div>
</field>
</record>
这样,名称更改了,但 body 仍然没有应用更改。这是 Odoo 对更改原生模板的限制吗? 任何帮助将不胜感激。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。