While generating PDF reports in Odoo on Ubuntu 22.04, you might face issues such as:
- Missing or incomplete headers and footers
- Logos not appearing in reports
- Mixed content rendering errors
This problem often stems from the wkhtmltopdf version (wkhtmltox_0.12.6-1) installed on your system, which lacks the required Qt patching to handle these features properly. This version is known to cause compatibility issues on Ubuntu 22.04.
The recommended fix is to downgrade wkhtmltopdf to version 0.12.5-1. This version works seamlessly with Odoo and ensures proper rendering of headers, footers, and logos.
Log in to your server using SSH or a terminal application like PuTTY.
Run the following command to check the installed version:
wkhtmltopdf --version If the version is 0.12.6, it needs to be removed and replaced with 0.12.5-1.
Uninstall the current version and clean up any residual dependencies:
sudo apt remove wkhtmltopdf
sudo apt autoremoveDownload the compatible version and install it:
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt-get install xfonts-75dpi
sudo apt-get updateIf you encounter broken dependencies, fix them by running:
sudo apt --fix-broken installRestart the Odoo service to apply the changes:
sudo service odoo-server restartGenerate a PDF report in Odoo. The headers, footers, and logos should now render correctly.
If you are using Odoo behind an Nginx server with an SSL certificate, make sure to configure the dbfilter in your Odoo configuration file (odoo.conf). This ensures that Odoo properly handles the database selection when accessed over HTTPS.
In your odoo.conf, add or update the following line to use a specific database name:
dbfilter = ^your_data_base_name$This will allow Odoo to correctly identify and select the database based on the exact database name when SSL is enabled.
If you have a database named customer1, you would configure your dbfilter as follows:
dbfilter = ^customer1$This ensures that when users access yourdomain.com, Odoo will select the customer1 database.
This configuration ensures that Odoo will match the subdomain or domain to the specified database name, providing seamless database handling when SSL is enabled.