[16.0][ADD] purchase_order_report_hide_tax: New module#91
[16.0][ADD] purchase_order_report_hide_tax: New module#91OCA-git-bot merged 1 commit intoOCA:16.0from
Conversation
Gelojr
left a comment
There was a problem hiding this comment.
Nice job @chienandalu but when testing with purchase order lines containing taxes from different groups (for example 21% VAT and 10% VAT), the report Request for quotation does not display the tax column, even though it should appear in this case.
Additionally, attempting to print the purchase order using “Print → Purchase Order” raises a traceback instead of generating the PDF.
Traceback (most recent call last):
File "<777>", line 1011, in template_777
File "<777>", line 993, in template_777_content
File "<777>", line 482, in template_777_t_call_0
KeyError: 'doc'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/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/odoo/http.py", line 763, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/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/addons/account/models/ir_actions_report.py", line 66, in _render_qweb_pdf
return super()._render_qweb_pdf(report_ref, res_ids=res_ids, data=data)
File "/opt/odoo/odoo/addons/base/models/ir_actions_report.py", line 910, in _render_qweb_pdf
collected_streams = self._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
File "/opt/odoo/addons/account_edi_ubl_cii/models/ir_actions_report.py", line 65, in _render_qweb_pdf_prepare_streams
collected_streams = super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
File "/opt/odoo/addons/account_edi/models/ir_actions_report.py", line 14, in _render_qweb_pdf_prepare_streams
collected_streams = super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
File "/opt/odoo/addons/account/models/ir_actions_report.py", line 25, in _render_qweb_pdf_prepare_streams
return super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
File "/opt/odoo/odoo/addons/base/models/ir_actions_report.py", line 761, in _render_qweb_pdf_prepare_streams
html = self.with_context(**additional_context)._render_qweb_html(report_ref, all_res_ids_wo_stream, data=data)[0]
File "/opt/odoo/odoo/addons/base/models/ir_actions_report.py", line 985, in _render_qweb_html
return self._render_template(report.report_name, data), 'html'
File "/opt/odoo/odoo/addons/base/models/ir_actions_report.py", line 664, in _render_template
return view_obj._render_template(template, values).encode()
File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 2135, in _render_template
return self.env['ir.qweb']._render(template, values)
File "/opt/odoo/odoo/tools/profiler.py", line 301, in _tracked_method_render
return method_render(self, template, values, **options)
File "/opt/odoo/odoo/addons/base/models/ir_qweb.py", line 593, in _render
result = ''.join(rendering)
File "<778>", line 80, in template_778
File "<778>", line 62, in template_778_content
File "<778>", line 50, in template_778_t_call_0
File "<777>", line 1017, in template_777
odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
KeyError: 'doc'
Template: purchase.report_purchaseorder_document
Path: /t/t/div/table/thead/tr/th[2]
Node: <th name="th_taxes" t-if="doc.show_tax_column_in_report"/>
The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPC_ERROR
at makeErrorFromResponse (http://oca-purchase-reporting-16-0-pr91-c72837ba5f3c.runboat.odoo-community.org/web/assets/427-a95bc99/web.assets_backend.min.js:1003:163)
at decoder.onload (http://oca-purchase-reporting-16-0-pr91-c72837ba5f3c.runboat.odoo-community.org/web/assets/427-a95bc99/web.assets_backend.min.js:990:7)
c72837b to
126c5b1
Compare
|
@Gelojr Try it again please. Please note that the RfQ report doesn't show either taxes or prices at all. Only the purchase order document does. |
Gelojr
left a comment
There was a problem hiding this comment.
Great work @chienandalu !
The following tests have been successfully performed:
- Test 1: Verified that when all purchase order lines share the same tax group, the tax column is correctly hidden in the report.
- Test 3: Confirmed that section and note lines do not interfere with the visibility logic of the tax column.
- Test 4: Verified that different taxes within the same tax group (e.g., 21% goods and 21% services) still hide the tax column as expected.
- An additional check was made: printing the purchase order using “Print → Purchase Order” raises a traceback instead of generating the PDF.
|
/ocabot rebase |
|
@rafaelbn The rebase process failed, because command |
|
/ocabot merge patch |
|
On my way to merge this fine PR! |
|
Congratulations, your PR was merged at 5163191. Thanks a lot for contributing to OCA. ❤️ |
cc @moduon MT-11623