Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1011 Vistas

Title: Translating Customized Invoice PDF Description Column in Odoo v17

Issue Description: Hello Odoo community,

I'm currently using Odoo v17, and I've made modifications to the invoice PDF template. Specifically, I've replaced the Description column with the following code:

However, I'm facing an issue with making this part translatable. Despite changing languages, the translation doesn't reflect in this section of the invoice.

Attempts Made: I've attempted to export terms for translation, but unfortunately, this particular term does not export along with others.

Request for Assistance: Could someone please guide me on how to ensure that the customized section in the invoice PDF template, particularly the Description column, can be translated properly when changing languages within Odoo v17? Any insights or suggestions would be greatly appreciated.

Thank you in advance for your help!



full code:


Avatar
Descartar
Autor Mejor respuesta

this term won't export solution I found is: 

                   <!-- Translate string -->                    <t t-if="doc.create_uid.lang == 'lt_LT'">                        <span>Eilės<br/>Nr.</span>                    </t>                    <t t-else="">                        <span>Rows<br/>No.</span>                    </t>

Avatar
Descartar
Mejor respuesta

Hi,

To add the translations for the customized report, first, you need to export the translation file from settings -> translation-> export translation


From this, you can choose the language of the translation and the module of your custom module, And export the file.
Inside the file, you can see the text of your customized data. Add your translated data there
Finally, you can add this file to your custom module inside the directory "i18n"


Hope it helps

Avatar
Descartar