From e8f8b93bd1c4596fef95d2a5bd3182af1b200cf7 Mon Sep 17 00:00:00 2001 From: "Nicolas (vin)" Date: Wed, 18 May 2022 08:47:54 +0000 Subject: [PATCH] [FIX] base: don't assume res_ids is a list https://github.com/odoo/odoo/pull/85150 introduced the method _render_qweb_pdf_prepare_streams called from _render_qweb_pdf giving it its res_ids. Two places in this method are assuming res_ids will be a list, but it is not always the case. Plenty of call to _render_qweb_pdf is giving it a single id as a parameter. This will ensure that res_ids is a list by creating one for single ids too before proceeding with the logic of the pdf rendering. closes odoo/odoo#91631 Signed-off-by: Laurent Smet --- odoo/addons/base/models/ir_actions_report.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/addons/base/models/ir_actions_report.py b/odoo/addons/base/models/ir_actions_report.py index 8a954087d4c..529a774a3df 100644 --- a/odoo/addons/base/models/ir_actions_report.py +++ b/odoo/addons/base/models/ir_actions_report.py @@ -764,6 +764,8 @@ class IrActionsReport(models.Model): self.ensure_one() if not data: data = {} + if isinstance(res_ids, int): + res_ids = [res_ids] data.setdefault('report_type', 'pdf') self_sudo = self.sudo()