-
-
Notifications
You must be signed in to change notification settings - Fork 862
Open
Labels
Description
Summary
The test_report test fails because xlrd 2.0+ dropped support for .xlsx files. The test uses xlrd.open_workbook() to verify generated xlsx output, but xlrd 2.0+ only supports legacy .xls (BIFF) format.
Affected versions
- Odoo: 18.0
- OCA repository: OCA/reporting-engine / branch: 18.0
- Module(s):
report_xlsxversion18.0.1.1.2
Environment
- Deployment: Odoo.sh
- OS: Linux (Odoo.sh container)
- Python: 3.x (system default)
- PostgreSQL: 14+
- xlrd: 2.0+ (system package
/usr/lib/python3/dist-packages/xlrd/)
Steps to reproduce
- Install
report_xlsxmodule on Odoo 18.0 - Run tests:
-i report_xlsx --test-enable - Observe
test_reportfails
Expected behavior
All tests pass. The generated xlsx file content is verified successfully.
Actual behavior
test_report raises XLRDError because xlrd 2.0+ cannot read xlsx files.
Error / Traceback / Logs
2025-12-17 17:09:31,943 22 INFO ... odoo.addons.report_xlsx.tests.test_report: Starting TestReport.test_report ...
2025-12-17 17:09:31,953 22 ERROR ... odoo.addons.report_xlsx.tests.test_report: ERROR: TestReport.test_report
Traceback (most recent call last):
File "/home/odoo/src/user/report_xlsx/tests/test_report.py", line 31, in test_report
wb = open_workbook(file_contents=rep[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/xlrd/__init__.py", line 170, in open_workbook
raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')
xlrd.biffh.XLRDError: Excel xlsx file; not supported
2025-12-17 17:09:32,002 22 ERROR ... odoo.modules.loading: Module report_xlsx: 0 failures, 1 errors of 4 tests
Additional context
- Frequency: Always (100% reproducible on systems with xlrd ≥2.0)
- Root cause: xlrd 2.0.0 (Dec 2020) dropped xlsx support. From xlrd changelog: "xlrd 2.0+ only supports .xls files. For xlsx, use openpyxl."
- Module functionality is NOT affected — only the test verification is broken. The xlsx generation via
xlsxwriterworks correctly. - Suggested fix: Replace
xlrdwithopenpyxlin test dependencies:
References
- xlrd changelog: https://xlrd.readthedocs.io/en/latest/changes.html
- openpyxl docs: https://openpyxl.readthedocs.io/