2

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?

M.E.
  • 4,955
  • 4
  • 49
  • 128

1 Answers1

0
    <?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!

Nguyen Vu
  • 66
  • 4
  • As mentioned above, the custom sale order document IS actually translated, what lost translation is the email template (which has not been modified at all) – M.E. Jul 11 '17 at 21:48
  • Did you try this " ${object.partner_id.lang}" ? – Nguyen Vu Jul 12 '17 at 02:18
  • I did, without success. I suspect that sale order mail template was not translated or that there was something funny. I did the translation manually in the GUI and it works now. – M.E. Jul 12 '17 at 04:13