Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
1667 Visualizzazioni

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.

Avatar
Abbandona
Autore Risposta migliore

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.

Avatar
Abbandona
Risposta migliore

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.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
gen 25
1097
1
lug 25
2693
3
feb 24
4316
3
feb 24
34298
1
lug 25
448