From 5b7b1d47afefd1e6eec6dadffb03d5e77e7d45a1 Mon Sep 17 00:00:00 2001 From: fkantelberg Date: Wed, 31 Jul 2024 15:22:08 +0200 Subject: [PATCH] Skip printing if no reports are printable --- delivery_automatic_print/models/stock_picking.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/delivery_automatic_print/models/stock_picking.py b/delivery_automatic_print/models/stock_picking.py index 0a41aa1..51d429d 100644 --- a/delivery_automatic_print/models/stock_picking.py +++ b/delivery_automatic_print/models/stock_picking.py @@ -34,6 +34,7 @@ def button_validate(self): else: pickings = self - report.sudo()._render_qweb_pdf(pickings.ids) + if pickings: + report.sudo()._render_qweb_pdf(pickings.ids) return res