ventor-tech / merp

mERP Warehouse free addons to simplify works with scanner
28 stars 40 forks source link

outgoing_routing - AttributeError: 'stock.package_level' object has no attribute '_compute_operation_valid' #329

Open gabe-grinspan opened 2 months ago

gabe-grinspan commented 2 months ago

I have an error that seems to be related to a report modification in the outgoing_routing module. I am running the latest version in Odoo 16.0. I'm not sure exactly how this was produced, but I am seeing the following error in my logs file.

2024-08-27 21:18:27,755 3695295 ERROR database odoo.addons.web.controllers.report: Error while generating report stock.report_picking Traceback (most recent call last): File "<875>", line 1485, in template_875 File "<875>", line 1467, in template_875_content File "<875>", line 1449, in template_875_t_call_0 File "<875>", line 1192, in template_875_t_call_1 File "/opt/odoo-prod/my-addons/outgoing_routing/models/stock_picking.py", line 49, in sort_printer_picking_list return self.sort_operations(move_line_ids, strategy, strategy_order) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/my-addons/outgoing_routing/models/stock_picking.py", line 75, in sort_operations validated_operations = all_operations.filtered(lambda op: op._compute_operation_valid()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/odoo/odoo/models.py", line 5447, in filtered return self.browse([rec.id for rec in self if func(rec)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/odoo/odoo/models.py", line 5447, in return self.browse([rec.id for rec in self if func(rec)]) ^^^^^^^^^ File "/opt/odoo-prod/my-addons/outgoing_routing/models/stock_picking.py", line 75, in validated_operations = all_operations.filtered(lambda op: op._compute_operation_valid()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'stock.package_level' object has no attribute '_compute_operation_valid'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/odoo-prod/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-prod/odoo/odoo/http.py", line 716, in route_wrapper result = endpoint(self, *args, params_ok) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/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-prod/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 "/opt/odoo-prod/odoo/odoo/addons/base/models/ir_actions_report.py", line 879, in _render_qweb_pdf collected_streams = self._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/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-prod/odoo/addons/account/models/ir_actions_report.py", line 20, in _render_qweb_pdf_prepare_streams return super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/odoo/odoo/addons/base/models/ir_actions_report.py", line 730, 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-prod/enterprise/web_studio/models/ir_actions_report.py", line 19, in _render_qweb_html return super(IrActionsReport, self)._render_qweb_html(report_ref, docids, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/odoo/odoo/addons/base/models/ir_actions_report.py", line 929, in _render_qweb_html return self._render_template(report.report_name, data), 'html' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/odoo/odoo/addons/base/models/ir_actions_report.py", line 639, in _render_template return view_obj._render_template(template, values).encode() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/odoo/odoo/addons/base/models/ir_ui_view.py", line 2127, in _render_template return self.env['ir.qweb']._render(template, values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/odoo/odoo/tools/profiler.py", line 292, in _tracked_method_render return method_render(self, template, values, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/odoo-prod/odoo/odoo/addons/base/models/ir_qweb.py", line 587, in _render result = ''.join(rendering) ^^^^^^^^^^^^^^^^^^ File "<875>", line 1491, in template_875 odoo.addons.base.models.ir_qweb.QWebException: Error while render the template AttributeError: 'stock.package_level' object has no attribute '_compute_operation_valid' Template: stock.report_picking Path: /t/t/t/t/div/table[2]/tbody/tr Node:

ventor-ecosystem commented 2 months ago

Hi, Thank you for contacting us!

We will fix it soon