Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How to translate custom fields in a report ?

By
Anne-Sylvie Burri
on 6/7/13, 7:16 AM 2,912 views

Hi everybody !

I just created a new module to add fields in my invoice. I already created a .po file to translate my fields and it works perfectly inside OpenERP. But when I print my invoice, the translation doesn't works.

I think I have to create a new folder "report" in addons/mymodule and create new files inside but I really have no idea of which files I have to create and which code to put inside.

Someone could help me ?

Many thanks in advance.

JMB

2

patrick

--patrick--
1958
| 5 4 7
Baarn, Netherlands
--patrick--
patrick
On 6/7/13, 8:23 PM

In order to translate you need:

  • folder called i18n
  • file module_name.pot within i18n (example: mymodule.pot)
  • file language.po (or languate_country.po) within i18n (example nl.po or nl_BE.po)

For a report, you need lines within the .pot:

#: report:sale.order:0
msgid "Offer"
msgstr ""

within the .po:

#: report:sale.order:0
msgid "Offer"
msgstr "Offerte"

The issues I have run into are:

  • updating the .pot and .po files does not always show on the reports, if these have been stored. So you need to create a new situation and print the report for the first time.
  • When you miss an entry in your .po file, there might be a default entry in the database, and that one will be used, even if you update your .po file.
  • it does matter where you place your :. A text like "the answer:" will not be translated it you store "the answer" or "the answer :" in your .pot and .po files.

It works perfectly ! Thanks :)

J.-M. Burri - Bureau ing.-conseils informatique, Anne-Sylvie Burri
on 6/10/13, 10:44 AM
0
akram
On 7/25/15, 8:09 AM

Follow below steps:

1) Go to

Settings ‣ Translations ‣ Import / Export ‣ Export Translations

leave the language to the default (new language/empty template) # DO NOT CHANGE THIS

select the PO File format

select your module

click Export and download the file

2) Add your translation terms in the downloaded file. i.e. msgstr "" section depending on your translation language

3) change the filename to language_iso_code.po

e.g. for portugese => pt.po

4) create i18n folder under your module and add po file in it.

5) restart Odoo

6) Go to:

Settings ‣ Translations ‣ Load a Translation

select translation language (in my eg. Portugese)

make sure you check this : Overwrite Existing Terms

click LOAD.

DONE

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 6/7/13, 7:16 AM
Seen: 2912 times
Last updated: 7/25/15, 8:09 AM