Skip to content

[17.0] account: Unable to print invoice report #185673

@adrip-s73

Description

@adrip-s73

Odoo Version

  • 16.0
  • 17.0
  • 18.0
  • Other (specify)

Steps to Reproduce

To replicate the problem we have to complete the following steps:
1 - Have the 'account_edi' module installed
2 - Have an invoice which has an edi document
image
3 - Print the regular invoice and at this point is where the following error appears
image

We have seen that this error comes from the change made in the following commit e391863 but reverting the commit does not solve it because the library has been updated, so for now leaving the code in this way has worked for us.
image

Log Output

raceback (most recent call last):
File "/opt/odoo/src/odoo/odoo/addons/web/controllers/report.py", line 113, in report_download
response = self.report_routes(reportname, docids=docids, converter=converter, context=context)
File "/opt/odoo/src/odoo/odoo/odoo/http.py", line 757, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/src/oca/reporting-engine/report_xlsx_helper/controllers/main.py", line 51, in report_routes
return super().report_routes(reportname, docids, converter, **data)
File "/opt/odoo/src/odoo/odoo/odoo/http.py", line 757, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/src/oca/reporting-engine/report_xlsx/controllers/main.py", line 51, in report_routes
return super().report_routes(reportname, docids, converter, **data)
File "/opt/odoo/src/odoo/odoo/odoo/http.py", line 757, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/src/odoo/odoo/addons/web/controllers/report.py", line 42, in report_routes
pdf = report.with_context(context)._render_qweb_pdf(reportname, docids, data=data)[0]
File "/opt/odoo/src/oca/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 "/opt/odoo/src/odoo/odoo/addons/account/models/ir_actions_report.py", line 58, in _render_qweb_pdf
return super()._render_qweb_pdf(report_ref, res_ids=res_ids, data=data)
File "/opt/odoo/src/oca/report-print-send/base_report_to_printer/models/ir_actions_report.py", line 159, in _render_qweb_pdf
document, doc_format = super()._render_qweb_pdf(
File "/opt/odoo/src/odoo/odoo/odoo/addons/base/models/ir_actions_report.py", line 911, in _render_qweb_pdf
collected_streams = self._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
File "/opt/odoo/src/odoo/odoo/addons/sale_pdf_quote_builder/models/ir_actions_report.py", line 15, in _render_qweb_pdf_prepare_streams
result = super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
File "/opt/odoo/src/enterprise/zenterprise/zenterprise/account_followup/models/ir_actions_report.py", line 12, in _render_qweb_pdf_prepare_streams
res = super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids)
File "/opt/odoo/src/odoo/odoo/addons/account_edi/models/ir_actions_report.py", line 44, in _render_qweb_pdf_prepare_streams
writer.write(new_pdf_stream)
File "/venv/lib/python3.10/site-packages/pypdf/_writer.py", line 1394, in write
self.write_stream(stream)
File "/opt/odoo/src/odoo/odoo/odoo/tools/pdf/init.py", line 100, in write_stream
self.add_metadata({
File "/venv/lib/python3.10/site-packages/pypdf/_writer.py", line 1599, in add_metadata
assert isinstance(self._info, DictionaryObject)
AssertionError

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
at makeErrorFromResponse (http://localhost:8069/web/assets/debug/web.assets_web.js:27958:19)
at decoder.onload (http://localhost:8069/web/assets/debug/web.assets_web.js:27841:25)

Support Ticket

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions