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.

2

Translation of strings in python code in RML reports

By
Ahmad Khayyat
on 2/16/13, 9:52 PM 2,698 views

Some strings in reports are never translated, despite them being translated in other places of the system.

Example: Chart of Accounts in the General Ledger report. Chart of Accounts is translated correctly in other places of the system, such as in the Accounting menu, but not in the General Ledger report.

Looking into the RML file of the General Ledger report, I found that, unlike most other strings, Chart of Accounts is enclosed in a python code tag [1]:

<para style="terp_tblheader_General_Centre">[[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para>

How can strings in python code tags in the RML file be translated?

[1] doc.openerp.com/v6.1/developer/05_reports.html#code-within-tags-is-python-code

0
Nicolas Clavier
On 2/22/13, 4:49 AM

Have you tried the gettex(() function : _("text to translate") Since eval() is applied to this code, it should know about the gettex() and record an entry in ir.translation. To be confirmed. Nicolas

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

1 follower(s)

Stats

Asked: 2/16/13, 9:52 PM
Seen: 2698 times
Last updated: 3/16/15, 8:10 AM