电子邮件模板翻译Odoo 10
问题描述:
我已经在自定义文档模块中实现了自定义模板,该模块取代了标准的销售订单文档.
I have implemented a custom template in a custom document module which replaces the standard sale order document.
<!--Email template -->
<record id="sale.email_template_edi_sale" model="mail.template">
<field name="report_template" ref="report_custom_sale_order"/>
</record>
这可以正常工作,但是现在电子邮件模板未翻译成用户/合作伙伴语言(在这种情况下为西班牙语).关于为什么发生这种情况以及如何解决的任何提示?
This works fine but now email template is NOT translated into user/partner language (Spanish in this case). Any tip on why this is happening and how to fix it?
答
<?xml version="1.0"?>
<t t-name="account.report_invoice">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_invoice_document')"/> </t> </t>
</t>
您应该在Qweb报告模板中添加"t-raw ="translate_doc"行!
You should add "t-raw="translate_doc" line to your Qweb report template!