Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0] sale_order_ubl TypeError: a bytes-like object is required, not 'tuple' #190

Closed
jchanme opened this issue Apr 17, 2020 · 3 comments · Fixed by #195
Closed

[12.0] sale_order_ubl TypeError: a bytes-like object is required, not 'tuple' #190

jchanme opened this issue Apr 17, 2020 · 3 comments · Fixed by #195

Comments

@jchanme
Copy link

jchanme commented Apr 17, 2020

When I tried to print a quotation, either the button or action menu, it will prompt an error:
Odoo Server Error Traceback (most recent call last): File "/opt/odoo/odoo-12/addons/web/controllers/main.py", line 1671, in report_download response = self.report_routes(reportname, docids=docids, converter=converter) File "/opt/odoo/odoo-12/odoo/http.py", line 519, in response_wrap response = f(*args, **kw) File "/opt/odoo/addons-test/report_xlsx/controllers/main.py", line 59, in report_routes reportname, docids, converter, **data File "/opt/odoo/odoo-12/odoo/http.py", line 519, in response_wrap response = f(*args, **kw) File "/opt/odoo/odoo-12/addons/web/controllers/main.py", line 1612, in report_routes pdf = report.with_context(context).render_qweb_pdf(docids, data=data)[0] File "/opt/odoo/addons-test/sale_order_ubl/models/report.py", line 22, in render_qweb_pdf pdf_content = order.embed_ubl_xml_in_pdf(pdf_content=pdf_content) File "/opt/odoo/addons-test/sale_order_ubl/models/sale.py", line 193, in embed_ubl_xml_in_pdf pdf_content=pdf_content, pdf_file=pdf_file) File "/opt/odoo/addons-test/base_ubl/models/ubl.py", line 529, in embed_xml_in_pdf original_pdf_file = BytesIO(pdf_content) TypeError: a bytes-like object is required, not 'tuple'

I went through the server debug log, there is nothing like this, the last lines of logs is like this:
2020-04-17 04:38:29,773 21872 DEBUG test odoo.addons.base_ubl.models.ubl: Starting to embed UBL-Quotation-2.1.xml in PDF file 2020-04-17 04:38:29,779 21872 INFO test werkzeug: 10.10.10.50 - - [17/Apr/2020 04:38:29] "POST /report/download HTTP/1.0" 200 - 453 0.815 8.514

I can't figure out why this is happening, can anyone help?

@cvinh
Copy link

cvinh commented Apr 25, 2020

I noticed that @alexis-via improved the reporting engine here 919275e#diff-1a1059837c383f5c8f3831ffd2260b9a
but the sale_order_ubl module hasn't been updated to that improvement

@cvinh
Copy link

cvinh commented Apr 25, 2020

I did a PR here : #195

@jchanme
Copy link
Author

jchanme commented Apr 30, 2020

@cvinh @alexis-via Thank you for the PR and the merge! Great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants