If you've followed my previous tutorial on how to install Odoo 17 using Docker, you might have encountered an issue where wkhtmltopdf
doesn't work properly. This is a common problem many face during PDF generation, and it’s caused by a wkhtmltopdf
bug when running inside certain Docker environments.
The Problem
When generating PDFs in Odoo (e.g., for invoices or reports), the result might look broken — not only is the header missing, but also the CSS and overall styling fail to load properly. This typically happens because wkhtmltopdf
cannot access the correct internal URLs or assets during rendering in a Docker container.
Broken PDF example:
The Solution
To fix this issue, you just need to add a system parameter in Odoo's settings:
- Navigate to Settings → Technical → Parameters → System Parameters.
- Add the following parameter:
💡 If you don’t see the "System Parameters" menu, make sure you have activated developer mode.
Fixed PDF
While wkhtmltopdf
bugs can be frustrating, this quick fix will save you hours of troubleshooting. Once you set the report.url
parameter, your reports should render perfectly with the correct headers, styles, and layout. This is especially important because printing is deeply integrated across many Odoo modules from quotations to logistics.
Top comments (0)