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?
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
Thanks
Hi E.M,
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:
<template id="my_custom_report">
<t t-call="report.html_container">
<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')"/>
</t>
</t>
</template>
Yenthe
Thanks Yenthe. The report actually had the t-raw argument specifing to use partner_id.lang which made me check configured language for the partner, which was English. I did not notice/know that report language depends on partner language (which clearly makes sense).
No problem E.M! And now you know. :) Best of luck.
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
2
ต.ค. 22
|
29910 | |||
|
0
ส.ค. 23
|
2146 | |||
|
0
พ.ย. 22
|
7327 | |||
|
QWeb format text and field in same line
แก้ไขแล้ว
|
1
ธ.ค. 23
|
19843 | ||
|
0
มิ.ย. 16
|
4941 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.