This question has been flagged
1 Reply
6954 Views

I created a report with a table that has columns with the name, in the XML the name is in english but I would like to translate them into other languages, at the moment I tried with Italian but they remain in English. Column names are not the name of any model field. To create the report I took the odoo addons as an example, then to create the cycle report on docs by passing it partner_id.lang when I call the template.

imgpaste.net/image/oUuIz

call the report with docs loop


<template id="report_certificate">
    <t t-call="web.html_container">
        <t t-foreach="docs" t-as="o">
            <t t-set="lang" t-value="o.partner_id.lang"/>
            <t t-call="ngo_payment_certificate.report_certificate_view" t-lang="lang"/>
        </t>
    </t>
</template>


<template id="report_certificate_view">
    <t t-set="o" t-value="o.with_context(lang=lang)" />
    <t t-call="web.external_layout">
                   <t t-set="address">
                <address t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
            <div t-if="o.partner_id.vat" class="mt16"><t t-esc="d.company_id.country_id.vat_label or 'Tax ID'"/>: <span t-field="o.partner_id.vat"/></div>
        </t>
        <div class="page">
            <p t-esc="lang"></p>
                <h3 class="text-left mt16">Donations</h3>
        </div>
    </t>
</template>


I created the po file and added it to the addon by correctly translating the words. I reloaded the language by overwriting and restarted the server but nothing. He does not translate words for me.

Can you help me? After much research I was unable to find a solution. The rest of the addon, form, treeview etc, are translated correctly

I use Odoo 12 CE Odoo 12.0-20200121

Avatar
Discard
Best Answer

Hi Paulo:

Your report templates look okay. Go to partner's Contact record and check whether the Language field is set correctly.

Avatar
Discard
Author

Hi Paresh, yes I checked that the partner has the correct language, you can see from the image that for security I print on the screen the lang field used by the report.

imgpaste.net/image/oUuIz

Go to Settings > Translations > Translated Terms (under "Application Terms") and search for the column names to see if they are translated. If they are missing you can use Settings > Translations > Generate Missing Terms and select the language (Italian) to generate the translation entries for anything that may be missing.