dms_file.py Raises "file name is invalid" Error when trying to print an Invoice
This is on Odoo 16.0-20240216 (Community Edition)
Module
Error shows exception thrown in dms
Describe the bug
Create and confirm invoice. As soon as one tries to send and print or just print the following error is thrown:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1633, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 133, in retrying
result = func()
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1660, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1774, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_http.py", line 237, in _dispatch
response = super()._dispatch(endpoint)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/mnt/extra-addons/reporting-engine/report_xlsx_helper/controllers/main.py", line 52, in report_routes
return super().report_routes(reportname, docids, converter, **data)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/mnt/extra-addons/reporting-engine/report_xlsx/controllers/main.py", line 49, in report_routes
return super().report_routes(reportname, docids, converter, **data)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/mnt/extra-addons/various/prt_report_attachment_preview/controllers/report.py", line 157, in report_routes
pdf = report_obj.with_context(**context)._render_qweb_pdf(
File "/mnt/extra-addons/mis-builder/mis_builder/report/mis_report_instance_qweb.py", line 27, in _render_qweb_pdf
return super()._render_qweb_pdf(report_ref, res_ids, data)
File "/usr/lib/python3/dist-packages/odoo/addons/account/models/ir_actions_report.py", line 61, in _render_qweb_pdf
return super()._render_qweb_pdf(report_ref, res_ids=res_ids, data=data)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 869, in _render_qweb_pdf
self.env['ir.attachment'].create(attachment_vals_list)
File "
To Reproduce
This happens with any invoice
Steps to reproduce the behavior: 1.Create invoice 2.Confirm invoice 3.Print Invoice
Expected behavior The wizzard with the e-mail to send to customer should open or the file should be visible on the customer portal.
Additional context Nothing comes to mind besides the error message.
I have uninstalled the module and printing is now possible again.
It was the only way to manage to delete a file attachment type directory that was lurking in the database and not letting me print.
It seems one cannot use the attachments in the dms.
Is there any other information I might add that can be useful?
I have tried to reproduce the error you indicate but it is not possible because the file that is generated does not contain / characters (which would cause the error you indicate).
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.