Skip to Content
Menu
This question has been flagged
4 Replies
7338 Views

This is what my invoice and report layout looks like in the preview

It is the standard boxed layout except I changed one single thing: I removed the bottom horizontal separator

Here is the code( I highlighted the changes I did, which is only one line)


The changes I added work perfectly fine as you can see in the preview. (I know, I should add changes by adding a inherited view)

However, the moment I generate a pdf from this layout, it is missing the header and footer

This is what it looks like:


What am I doing wrong or what did I misconfigure?


Thank you for your help.


Info:

Odoo 15, Linux debian 11 bullseye, 2vCPUS 8GB Ram, 120 GB, odoo linux install (no docker)

Avatar
Discard
Best Answer

I have also the same problem on Odoo 16 Enterprise.

# wkhtmltopdf --version
wkhtmltopdf 0.12.6

The header and footer appear in the reports if I turn them into HTML report in the configuration.

So, I guess the problem is linked to wkhtmltopdf and a bad understanding of CSS.

I have tried also an other solution that you can find here:

https://www.odoo.com/fr_FR/forum/aide-1/how-to-solve-report-header-footer-missing-while-printing-195904

But adding the line...

command_args.extend(['--javascript-delay', str(1000)])

... do not change anything neither in my case..

No change neither by creating a configuration parameter report_url (by the way, if the parameter is missing for your configuration, you will not get any CSS formating)


The right solution was for me to downgrade wkhtmltopdf to 0.12.5 and add a patch on it.


# wkhtmltopdf --version
wkhtmltopdf 0.12.5 (with patched qt)


Now everything is working fine.






Avatar
Discard
Best Answer

@Josef Schmid: Did you, by any chance, find a solution to this problem? We face a similar problem: quotations/orders and invoices print correctly, pro forma invoices lack the header and footer.

We're running Odoo 14 Enterprise.

Avatar
Discard

@Timo If the issue is only with Pro Forma Invoice, Check the paper format set for the report.

Activate Developer Mode,

Goto Settings -> Technical -> Report

Search for PRO-FORMA Invoice and check the paper format,
You can also change Report Type to HTML and check whether it's showing the header and footer

Author

@Timo Denissen, I am still on the look, I will update you once I find something.

@Kiran Thanks :) I checked the paper format and it's correct. The header and footer is simpy just not printed. I think someone edited the core templates and after an update the changes got reverted. I check that at the moment.

Author Best Answer

When removing my changes, I still get no headers and footers. My changes do not appear to be the problem

Avatar
Discard

Have you got solution ? I have the same issue.

Author

@Mya Yahmone Hlaing unfortunately not, im still searching. In case you find something, let me know!

Best Answer

 Hi  Josef,

Activate Developer Mode

Goto Settings -> Technical -> Parameters -> System Parameters

Check whether report.url is set in system parameters.

Refer,
https://www.youtube.com/watch?v=lC9p_QJUW1Q

Avatar
Discard
Author

This was a great tip, as my report.url was still set to localhost. This also gave me the idea that the problem might have the same origin as an other problem I'm facing where, when i send an email with images, the images do not get displayed! I did set web.base.url tho...
Do you think these two might correlate? And how could i solve this?

It will not affect web.base.url,

Create a new parameter with,

key: report.url

value: your_ip:port

Author

@Kiran K, thanks for the answer! I tried to set the report.url to to my IP:Port and to my domain, neither of it worked out, unfortunately. Do you have another Idea?

Try changing the Report Type to HTML and check whether it's showing the header and footer.

Hope the value given for report.url and web.base.url are the same

Author

@Kiran K. Okay, I tried using HTML Report. There, the headers show up. Now, how can i get the same to work with PDF?

Related Posts Replies Views Activity
1
Mar 25
2416
2
Aug 25
2966
1
Apr 25
4383
2
Jul 24
5934
1
Apr 24
1775