Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Technical
  3. Fast WeasyPrint Reports v 18.0
  4. Sales Conditions FAQ

Fast WeasyPrint Reports

by Riste Kabranov https://odoomacedonia.mk
Odoo

$ 698.75

v 18.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 361
Technical Name cons_custom_reports
LicenseLGPL-3
Websitehttps://odoomacedonia.mk
Versions 18.0 19.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 361
Technical Name cons_custom_reports
LicenseLGPL-3
Websitehttps://odoomacedonia.mk
Versions 18.0 19.0
⚡

Fast WeasyPrint Reports

Replace Odoo's sluggish wkhtmltopdf engine with WeasyPrint — pure Python, runs in-process, 4-8× faster on every PDF report. One toggle in Settings. No layout changes. No broken reports.

Odoo 18 4-8× Faster PDFs Pure Python Auto Fallback Zero Layout Changes

😤 The Problem with wkhtmltopdf

Odoo ships with wkhtmltopdf as its default PDF engine. It works, but it has serious problems that get worse the busier your Odoo instance is:

🐌 2-3 seconds per PDF
Invoices, quotations, delivery slips — every click on "Print" blocks your user for 2-3 seconds while a headless browser warms up.
💀 Abandoned upstream
wkhtmltopdf's last release was 2020. No security patches, no CSS improvements, no new features. Odoo keeps shipping it because replacing it was hard.
⚙️ External binary dependency
Requires a system binary installed separately on every server, Docker container, and CI environment. Packaging nightmare on arm64 / Apple Silicon.
🎲 Flaky under load
Spawning a subprocess per print is expensive. Under concurrent load, wkhtmltopdf can timeout, crash, or produce silently corrupted PDFs.

📊 Speed Comparison

Benchmarked on an Odoo 18 customer invoice. Each measurement is an end-to-end render from the ir.actions.report override to the final PDF bytes written to the response stream.

wkhtmltopdf (stock) subprocess spawn + WebKit render
2.4 s
WeasyPrint (baseline) no CSS stripping, fonts downloaded
0.65 s
WeasyPrint + this module in-process + bundled fonts ✓
0.35 s
6.8×
faster than wkhtmltopdf
~2 s
saved per print click
0
layout changes required
100%
of your existing reports work
Where the speed comes from: WeasyPrint runs inside the Odoo Python process — no subprocess spawn, no headless browser, no IPC. The biggest remaining cost in a naive setup is WeasyPrint downloading every @font-face file the report declares (Lato in 8 weights plus icon and Google fonts). This module ships those fonts locally and blocks the remote downloads, so the fonts load straight from disk with zero network round-trips. Layout and fonts are identical to wkhtmltopdf — real Lato, not a fallback — only print performance changes.

⚙️ How It Works

1

Enable the toggle

Go to Settings → Fast Reports → Use WeasyPrint for All Reports and enable it. Save. Done.

2

Every PDF report becomes fast

All ir.actions.report PDF actions — invoices, quotations, delivery slips, purchase orders, inventory, payroll, custom modules — now render through WeasyPrint. Same templates, same data, faster output.

3

Automatic fallback safety net

If WeasyPrint fails on a specific report for any reason, the system automatically falls back to wkhtmltopdf for that one render — silently, with a warning in the log. No broken print buttons, ever.

4

Per-report escape hatch

If a complex third-party report renders incorrectly under WeasyPrint, go to Settings → Technical → Actions → Reports, find it, and tick Use Legacy Engine (wkhtmltopdf). That one report stays on the old engine while everything else benefits from WeasyPrint.

✨ Key Features

🐍

Pure Python — No Binary

WeasyPrint is a Python package. It installs with pip. No system-level binary to maintain, no PATH issues, no subprocess management. Works identically on Linux, macOS, and Windows.

🏎️

In-Process Rendering

No subprocess, no headless browser, no IPC. WeasyPrint runs inside the Odoo worker, so there's no 2-3 s process spawn on every print. The Bootstrap grid your templates depend on is preserved untouched — only screen-only backend CSS bundles are stripped.

🔤

Bundled Fonts (No Downloads)

Standard Odoo reports declare ~30 @font-face rules that WeasyPrint would download and decode on every render. This module ships Lato (the default report font) plus Roboto, Open Sans, Montserrat, Raleway, Oswald, Fira Mono and Tajawal locally, serving them from disk with zero network — so output is byte-identical to wkhtmltopdf, just fast.

🛡️

Crash-Safe Fallback

The render override wraps WeasyPrint in a try/except. If anything goes wrong, wkhtmltopdf runs instead and a warning is logged. Users never see an error — they just get their PDF, slightly slower.

🎛️

Per-Report Legacy Pin

A single boolean field on ir.actions.report lets you pin any individual report back to wkhtmltopdf. Useful as an escape hatch for reports with complex CSS that WeasyPrint renders differently.

🔇

Silent Operation

WeasyPrint normally floods the Odoo log with hundreds of CSS parse warnings from Bootstrap. This module silences WeasyPrint's loggers to ERROR level — only real failures appear. Clean logs.

📦 Installation

WeasyPrint is a pure-Python PDF engine but it depends on a few system graphics libraries (pango, cairo, gdk-pixbuf) that must be installed at the OS level — pip cannot install them. Follow the guide for your platform below.

macOS (Homebrew)

Works on both Intel and Apple Silicon (M1/M2/M3). Homebrew installs everything to /opt/homebrew/lib on Apple Silicon and /usr/local/lib on Intel — the module auto-detects the correct path at runtime.

1. Install system libraries:

brew install pango cairo gdk-pixbuf libffi

2. Install the Python package:

pip install weasyprint
Apple Silicon tip: if WeasyPrint fails to import after installation, add this to your shell rc (~/.zshrc) and restart the terminal:
export DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_FALLBACK_LIBRARY_PATH The module also preloads the libs automatically on startup as a belt-and-braces fallback.

3. Drop the module in:

cp -r cons_custom_reports /path/to/your/odoo/addons/

4. Restart Odoo, update app list, install:

Apps → Update Apps List → search "Fast WeasyPrint Reports" → Install

🐧 Linux

Debian / Ubuntu / Mint

sudo apt update sudo apt install -y \ libpango-1.0-0 libpangoft2-1.0-0 \ libcairo2 libgdk-pixbuf-2.0-0 \ libffi-dev shared-mime-info fonts-liberation pip install weasyprint

RHEL / Fedora / Rocky / AlmaLinux

sudo dnf install -y \ pango cairo gdk-pixbuf2 libffi \ shared-mime-info liberation-fonts pip install weasyprint

Alpine / Docker

RUN apk add --no-cache \ pango cairo gdk-pixbuf libffi ttf-liberation \ && pip install --no-cache-dir weasyprint
Odoo running as a dedicated user? Make sure you install weasyprint into that user's Python environment:
sudo -H -u odoo pip install weasyprint

🪟 Windows

WeasyPrint on Windows requires the GTK3 runtime for the underlying graphics libraries. Three steps:

1
Install the GTK3 runtime
Download and run the latest installer from the GTK for Windows project. During install, tick "Set up PATH environment variable to include GTK+".
https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases
2
Restart your terminal (so the PATH update takes effect)
Verify with: where libgtk-3-0.dll — you should see a path like C:\Program Files\GTK3-Runtime Win64\bin\
3
Install the Python package:
pip install weasyprint
Odoo Community for Windows? The official Windows installer bundles its own Python under C:\Program Files\Odoo 18\python\. Install into that interpreter:
"C:\Program Files\Odoo 18\python\python.exe" -m pip install weasyprint

☁️ odoo.sh (Managed PaaS)

On odoo.sh you can't SSH in to run pip install or apt install. Instead, commit two files to the root of your repo (not inside the module folder) and the build container picks them up automatically on every deploy.

requirements.txt (at repo root)

weasyprint

apt-packages (at repo root)

libpango-1.0-0 libpangoft2-1.0-0 libcairo2 libgdk-pixbuf-2.0-0 libffi-dev shared-mime-info fonts-liberation
Directory layout: these files sit next to your module folders — my-repo/requirements.txt, my-repo/apt-packages, my-repo/cons_custom_reports/. Push to your odoo.sh branch and the build handles the rest.

🎛️ Settings Reference

Settings → Fast Reports
Use WeasyPrint for All Reports Global toggle. When enabled, every ir.actions.report PDF action routes through WeasyPrint. Stored on res.company — each company can have a different setting in multi-company setups.
Settings → Technical → Actions → Reports → any report → PDF Engine tab
Use Legacy Engine (wkhtmltopdf) Per-report override. Ticking this on a specific report pins it to wkhtmltopdf regardless of the global setting. Use as an escape hatch for reports that render incorrectly under WeasyPrint.
System Parameters (ir.config_parameter)
cons_custom_reports.weasy_load_fonts Default (unset) = fast path: the locally bundled fonts are used and remote font downloads are blocked. The bundle already covers Odoo's standard report fonts, so output is faithful. Set to 1 only if a custom template references a web font that isn't bundled and you want WeasyPrint to fetch it — at the cost of a network round-trip per render.
cons_custom_reports.debug_dump_html Set to any truthy value to dump the rendered HTML to a temp file before WeasyPrint processes it. Useful for diagnosing layout issues. Check the Odoo log for the file path.

🛠️ Technical Notes

Single Override Point

The module overrides exactly one method: IrActionsReport._render_qweb_pdf_prepare_streams. This is the correct extension point for PDF engine swapping in Odoo 18 and is compatible with any module that doesn't also override this method.

macOS Auto-Bootstrap

On macOS, dyld's library path doesn't include Homebrew's lib directory. The module patches DYLD_FALLBACK_LIBRARY_PATH and preloads pango/cairo/gdk-pixbuf by absolute path at import time — so WeasyPrint imports successfully regardless of how Odoo was launched.

CSS Handling Detail

The print CSS (web.report_assets_pdf) and the Bootstrap grid (web.report_assets_common) are kept — your report layout depends on them. The stripper only removes screen-only backend UI bundles (web.assets_backend, web.assets_common) as a safety net for custom templates that accidentally pull them in; stock reports don't include those, so layout is always preserved.

No New Models

The module adds one boolean field to res.company and one to ir.actions.report. No new database tables, no new menu items, no new security groups. The security CSV is intentionally empty.

❓ Frequently Asked Questions

Will my existing report layouts look different?

In almost all cases: no. WeasyPrint implements the same CSS specs as a modern browser, and this module ships real Lato (Odoo's default report font) plus seven other common families locally — so text renders in the correct typeface, not a system fallback. Layout — margins, tables, page breaks, headers/footers — is identical. If a custom report uses a font that isn't bundled and you want WeasyPrint to download it, set cons_custom_reports.weasy_load_fonts = 1; or pin that report to the legacy engine.

Do I still need wkhtmltopdf installed?

Yes, keep it installed. The auto-fallback mechanism uses wkhtmltopdf when WeasyPrint fails on a specific report. If you're certain WeasyPrint handles all your reports correctly, you can remove wkhtmltopdf — but there's no advantage to doing so, and keeping it costs nothing.

Does this affect Odoo's email attachments (auto-generated PDFs)?

Yes — all PDF generation goes through ir.actions.report, including auto-attached PDFs sent by email (e.g. invoice PDFs sent to customers). They'll be generated faster too.

Is this compatible with Odoo Enterprise?

Yes. The override point is in Odoo Community (base). Enterprise adds fields and templates but doesn't change how _render_qweb_pdf_prepare_streams works, so this module is fully compatible with Enterprise report types (payslips, expense reports, etc.).

What happens if WeasyPrint is not installed and I enable the toggle?

WeasyPrint raises an ImportError on the first render attempt. The fallback catches it, logs a warning with installation instructions, and wkhtmltopdf renders the PDF instead. No data is lost and no user-visible error occurs — but every print will fall back until you install the package.

⚡

Make Every Print 6× Faster

Install Fast WeasyPrint Reports, enable one toggle, and your entire Odoo instance prints faster — invoices, quotations, delivery slips, payslips, everything.

Fast WeasyPrint Reports

Developed by Riste Kabranov

odoomacedonia.mk | ristecona@gmail.com

© 2026 Riste Kabranov. All Rights Reserved. · LGPL-3

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with