From ac03ae670923ab6f3d1ba898760830fd2f37ba89 Mon Sep 17 00:00:00 2001 From: Fernando Date: Sat, 16 May 2026 22:32:41 -0400 Subject: [PATCH] [FIX] report_csv: guard docids against None in _render_csv The _render_csv method called len(docids) without checking if docids is None, causing a TypeError when rendering CSV reports without passing record IDs (e.g., from the UI wizard). Fixes OCA/reporting-engine#1125 --- report_csv/models/ir_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report_csv/models/ir_report.py b/report_csv/models/ir_report.py index 66eb8ea5e9..b8f0edc244 100644 --- a/report_csv/models/ir_report.py +++ b/report_csv/models/ir_report.py @@ -55,7 +55,7 @@ def _render_csv(self, report_ref, docids, data): report_sudo = self._get_report(report_ref) report_model_name = f"report.{report_sudo.report_name}" report_model = self.env[report_model_name] - res_id = docids[0] if docids and len(docids) == 1 else None + res_id = docids[0] if docids else None if not res_id or not report_sudo.attachment or not report_sudo.attachment_use: return report_model.with_context( **{