Module
report_csv
Describe the bug
Rendering a CSV report fails with a TypeError when docids is None.
The _render_csv method assumes docids is always iterable and calls len(docids) without checking its value.
To Reproduce
Affected versions:
Steps to reproduce the behavior:
- Trigger a CSV report rendering without passing
docids
_render_csv is called with docids=None
- The method executes
len(docids)
- A
TypeError is raised
Expected behavior
CSV reports should render correctly even when docids is None, consistent with other Odoo report renderers.
Actual behavior
A TypeError is raised and the report rendering fails.
Additional context
Error:
TypeError: object of type 'NoneType' has no len()
Code reference:
|
res_id = len(docids) == 1 and docids[0] |
Environment:
OS: Linux
Python: 3.x
Odoo: 18.0
Module
report_csvDescribe the bug
Rendering a CSV report fails with a
TypeErrorwhendocidsisNone.The _render_csv method assumes
docidsis always iterable and callslen(docids)without checking its value.To Reproduce
Affected versions:
Steps to reproduce the behavior:
docids_render_csvis called withdocids=Nonelen(docids)TypeErroris raisedExpected behavior
CSV reports should render correctly even when
docidsisNone, consistent with other Odoo report renderers.Actual behavior
A
TypeErroris raised and the report rendering fails.Additional context
Error:
Code reference:
reporting-engine/report_csv/models/ir_report.py
Line 58 in 6d3b9f0
Environment:
OS: Linux
Python: 3.x
Odoo: 18.0