Odoo Warning - Wkhtmltopdf failed (error code: -11).

Learn what to do when the Wkhtmltopdf error is coming

This tutorial is going to show you how to fix "Odoo warning - Wkhtmltopdf failed" error. Whtmltopdf is required to print reports in pdf. If you don't have it installed in older Odoo versions you will get an error as in the title, in newer versions the reports will be displayed in html format.

Prepare yourself and Odoo

Start from backing up your server. If you will install wrong dependency it might be very hard to fix it.

Visit the Odoo documentation and check what is the Wkhtmltopdf recommended version for your Odoo (https://www.odoo.com/documentation/9.0/setup/install.html)

Odoo text and image block
Odoo image and text block

Log in to your system and install the dependency

Sample execution(For Ubuntu 16,04):

cd ~
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
tar vxf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz 
wkhtmltopdf --version

The last line will tell you what is the version installed. Remember to restart the server(not only the Odoo) to apply the changes.

Check if the pdf reports are printing

Log in to Odoo and check if everything prints ok.

If it does not work first time don't panic. Try to restart Odoo and restart server again.

Odoo text and image block
Odoo image and text block

Check also...

Errors  -11 and -6 may also be caused by Odoo setup. If it happens please check the odoo config file and add more memory to limit_memory_hard.

 

References

https://askubuntu.com/questions/959152/how-can-i-install-the-latest-wkhtmltopdf-on-ubuntu-16-04

https://www.odoo.com/documentation/9.0/setup/install.html

Better ask twice than do a mistake If you are not sure use Odoo Forum or AskUbuntu forum to get your questions answered..