Skip to content

Instantly share code, notes, and snippets.

@Sinnnnak
Last active November 3, 2025 16:53
Show Gist options
  • Select an option

  • Save Sinnnnak/57375c7abfb445ca8009cc5143b114ca to your computer and use it in GitHub Desktop.

Select an option

Save Sinnnnak/57375c7abfb445ca8009cc5143b114ca to your computer and use it in GitHub Desktop.
Fix Wkhtmltopdf Issues in Odoo PDF Reports on Ubuntu 22.04

Fixing Missing Headers, Footers, and Logos in Odoo PDF Reports on Ubuntu 22.04

Problem Description

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.


Solution: Downgrade wkhtmltopdf to Version 0.12.5-1

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.


Step-by-Step Guide

1. SSH into Your Server

Log in to your server using SSH or a terminal application like PuTTY.

2. Check the Current wkhtmltopdf Version

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.


3. Remove the Current Version

Uninstall the current version and clean up any residual dependencies:

sudo apt remove wkhtmltopdf
sudo apt autoremove

4. Download and Install wkhtmltopdf Version 0.12.5-1

Download 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 update

5. Fix Broken Dependencies

If you encounter broken dependencies, fix them by running:

sudo apt --fix-broken install

6. Restart Odoo

Restart the Odoo service to apply the changes:

sudo service odoo-server restart

Verification

Generate a PDF report in Odoo. The headers, footers, and logos should now render correctly.


Important Note: Odoo with Nginx and SSL

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.

Example:

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.


References


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment