Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have created a custom QWeb report as invoice template. However I do not know how to specify which language the report should use.
What should be done to specify a given language/translation for the used terms and fields?
This is specified in the XML file where you've built the report.An example for the quotation report in Odoo:
<template id="report_saleorder"> <t t-call="report.html_container"> <t t-foreach="doc_ids" t-as="doc_id"> <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_document')"/> </t> </t> </template>
That t-raw is telling to get the language from the partner which is filled in on the field partner_id.lang. The report will print in that language, provided it is installed and that there is a translation for the report.
If you don't have the language from some field on the form you can also get it from the 'lang' setting. An example:
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'lang', 'aa_maatwerk_wansheng.my_custom_report_document')"/>
About This Community
This platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 9/22/15, 5:43 AM|
|Seen: 2477 times|
|Last updated: 9/22/15, 5:48 PM|