Skip to content

Commit 6a52290

Browse files
committed
[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
1 parent 2a388f6 commit 6a52290

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

report_csv/models/ir_report.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _render_csv(self, report_ref, docids, data):
5555
report_sudo = self._get_report(report_ref)
5656
report_model_name = "report.%s" % report_sudo.report_name
5757
report_model = self.env[report_model_name]
58-
res_id = len(docids) == 1 and docids[0]
58+
res_id = (len(docids) == 1 and docids[0]) if docids else False
5959
if not res_id or not report_sudo.attachment or not report_sudo.attachment_use:
6060
return report_model.with_context(
6161
**{

0 commit comments

Comments
 (0)