In odoo 15 I have created a custom field "Unit" via an add on module for "Invoicing" app. This field contains a string (like "piece", "hours"…) and can be assigned per line in the invoice_lines. I now want to output this field also on the PDF report for the invoices at the position after "Quantity". Unfortunately I don't see in the developer modus how the fields can be called in the PDF reports. How can I include this field in the table of the invoice lines in the PDF document?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
2
ตอบกลับ
3568
มุมมอง
Hi
You can inherit the report.invoice_document template and using the XPath attribute add the field
Try this code
<template id="invoice_report_inherit"
inherit_id="account.report_invoice_document">
<xpath expr="//table[@name='invoice_line_table']/thead/tr/th[3]" position="after">
<span>Unit </span>
</xpath>
<xpath expr="//table[@name='invoice_line_table']/tbody//tr[1]//td[3]" position="after">
<td class="text-right"><span t-field="line.unit"/></td>
</xpath>
</template>
Regards
Ah, thanks! Changed the "span" into a "th", then it worked!
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
พ.ย. 24
|
1595 | ||
|
0
ส.ค. 24
|
1615 | ||
|
2
พ.ย. 23
|
3587 | ||
Multiple Report Printing at one button.
แก้ไขแล้ว
|
|
5
ส.ค. 23
|
9835 | |
|
2
พ.ค. 23
|
2603 |