0

I have translated Odoo email templates from English to Spanish, Italian and French but I need to send the attached invoice in Spanish always, no matter the language.

How can I do that?

I have tried:

  • specifying <field name="lang">es_ES</field> but it translates the email template too.
  • forcing <t t-raw="translate_doc(doc_id, doc_model, 'es_ES', 'wms_report.report_document')"/> but it throws an error because param has to be an attribute of object.
ChesuCR
  • 9,352
  • 5
  • 51
  • 114

1 Answers1

1
You can write this code and change your report template into partner's language.For ex. If your Invoice report partner's language is Spanish then report will print in Spanish lang.

  <template id="report_custom_invoice">
     <t t-call="report.html_container">
        <t t-foreach="docs" t-as="o">
            <t t-call="custom_template.report_invoice_custom" t-
               lang="o.partner_id.lang"/>
            </t>
        </t>
  </template>
Vibha Kachhela
  • 184
  • 1
  • 6
  • thank you but, I don't want to translate the document. I want send the email translated to italian, french, whatever... but the attachment always in spanish. – Marco Gonzalo Gómez Pérez Apr 07 '18 at 14:33
  • 1
    Okay. So for that you have to create your attachment template in Spanish. And for email template you have to change translation of your mail in below path (This is for odoo-v10). settings > technical > Email > Templates. And change your mail into Italian,french,whatever you want. – Vibha Kachhela Apr 14 '18 at 07:24
  • Well. I'm working with Odoo 8. Maybe, soon, I'll migrate to Odoo 10. Thanks – Marco Gonzalo Gómez Pérez Jul 28 '18 at 17:13