diff --git a/report_csv/models/ir_report.py b/report_csv/models/ir_report.py index 629108272c..5ae7a9b214 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 = len(docids) == 1 and docids[0] + res_id = docids and len(docids) == 1 and docids[0] if not res_id or not report_sudo.attachment or not report_sudo.attachment_use: return report_model.with_context( **{