Skip to content

Commit

Permalink
[FIX] report_csv: make it working if docids is False
Browse files Browse the repository at this point in the history
len() is used on docids, but in some cases, docids is False
wich raised a TypeError
  • Loading branch information
maisim committed Jan 8, 2025
1 parent 2a388f6 commit 6a52290
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion report_csv/models/ir_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
**{
Expand Down

0 comments on commit 6a52290

Please sign in to comment.