Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1919 มุมมอง

Hello,


How to condition, t-if xml tag, header and footer pdf template base on print action?


I want to use different header for these PDF


-Print invoice without payment

-Print invoice with payment

-Print multiple invoice

-Print comercial invoice

-Print receipt


I'm a very newbie. 


I've tried to locals() in linux terminal to list the variable, but there's nothing. 


I also tried xpath but it's not work.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I use viewid to resolve the issue follow this topic 

odoo<dot>com/nl_NL/forum/help-1/qweb-report-get-name-or-id-of-the-report-in-xml-150629

and thank you @Susan Navarro, I has no enough Karma to vote.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

To conditionally render different headers and footers in a PDF template in Odoo based on the print action, you can use the `t-if` directive in your QWeb template. The key is to pass a context variable from the action calling the report and use that variable in the template to determine which header or footer to display.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 25
1182
1
ก.ค. 25
2955
3
ก.พ. 24
4586
How change DEFAULT TEMPLATE for INVOICE แก้ไขแล้ว
3
ก.พ. 24
34675
1
ก.ค. 25
699