From 6a5229022e3bc5e9402992d53688f4660035fdda Mon Sep 17 00:00:00 2001 From: Simon Maillard Date: Wed, 8 Jan 2025 15:20:03 +0100 Subject: [PATCH] [FIX] report_csv: make it working if docids is False len() is used on docids, but in some cases, docids is False wich raised a TypeError --- 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 6e31e4b3e1..1e6fed499f 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 = "report.%s" % report_sudo.report_name report_model = self.env[report_model_name] - res_id = len(docids) == 1 and docids[0] + res_id = (len(docids) == 1 and docids[0]) if docids else False if not res_id or not report_sudo.attachment or not report_sudo.attachment_use: return report_model.with_context( **{