From 7b71480c19eba6dae3c20e67d438eda870f33700 Mon Sep 17 00:00:00 2001 From: "Walid HANNICHE (waha)" Date: Thu, 23 Feb 2023 17:17:58 +0000 Subject: [PATCH] [FIX] base: wkhtml2pdf large documents load Step to reproduce: Edit documents layout in general setting to add logo and background select multiple documents (more than 5) e.g. Inventory> delivery slips print all documents. Bug: background and logo missing on the last documents because the pages were printed before the browser had time to render them Fix: wkhtml2pdf has a default delay of 200 ms (--javascript-delay) increasing the value will allow large document to load opw-2951594 closes odoo/odoo#114512 X-original-commit: ac2df93eb3f08696189d010bdfa4187e02a94576 Signed-off-by: Julien Castiaux (juc) Signed-off-by: Walid Hanniche (waha) --- odoo/addons/base/models/ir_actions_report.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/odoo/addons/base/models/ir_actions_report.py b/odoo/addons/base/models/ir_actions_report.py index dfa31797db9..78fa3da97dd 100644 --- a/odoo/addons/base/models/ir_actions_report.py +++ b/odoo/addons/base/models/ir_actions_report.py @@ -296,6 +296,9 @@ class IrActionsReport(models.Model): if paperformat_id.disable_shrinking: command_args.extend(['--disable-smart-shrinking']) + # Add extra time to allow the page to render + command_args.extend(['--javascript-delay', '1000']) + if landscape: command_args.extend(['--orientation', 'landscape'])