From 12616ac1bd59661fd143f268261fd94bcf1788fd Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 11 May 2022 19:22:40 +0200 Subject: [PATCH] [FIX] report_qweb_encrypt: the case without res_ids --- report_qweb_encrypt/models/ir_actions_report.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/report_qweb_encrypt/models/ir_actions_report.py b/report_qweb_encrypt/models/ir_actions_report.py index 6f4be9bf6..2a15da2f4 100644 --- a/report_qweb_encrypt/models/ir_actions_report.py +++ b/report_qweb_encrypt/models/ir_actions_report.py @@ -34,10 +34,11 @@ class IrActionsReport(models.Model): document, ttype = super(IrActionsReport, self)._render_qweb_pdf( res_ids=res_ids, data=data ) - if isinstance(res_ids, int): - res_ids = [res_ids] - password = self._get_pdf_password(res_ids[:1]) - document = self._encrypt_pdf(document, password) + if res_ids: + if isinstance(res_ids, int): + res_ids = [res_ids] + password = self._get_pdf_password(res_ids[:1]) + document = self._encrypt_pdf(document, password) return document, ttype def _get_pdf_password(self, res_id):