问题
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?
回答1:
<?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>
You should add "t-raw="translate_doc" line to your Qweb report template!
来源:https://stackoverflow.com/questions/45021439/email-template-translation-odoo-10