From 6df0c9c740b2bfe44d0e40900447859ec78c513a Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 25 Feb 2022 19:51:05 +0100 Subject: [PATCH] [FIX] stock_picking_report_valued_sale_mrp: Don't write on compute field Update/direct assignation should be used instead. --- stock_picking_report_valued_sale_mrp/__manifest__.py | 2 +- .../models/stock_move_line.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stock_picking_report_valued_sale_mrp/__manifest__.py b/stock_picking_report_valued_sale_mrp/__manifest__.py index af7fe8d..14abc55 100644 --- a/stock_picking_report_valued_sale_mrp/__manifest__.py +++ b/stock_picking_report_valued_sale_mrp/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Valued picking linked with MRP Kits", "summary": "Allow to summarize the picking related with the selled kits", - "version": "13.0.1.0.0", + "version": "13.0.1.0.1", "development_status": "Beta", "category": "Warehouse Management", "website": "https://github.com/OCA/stock-logistics-reporting", diff --git a/stock_picking_report_valued_sale_mrp/models/stock_move_line.py b/stock_picking_report_valued_sale_mrp/models/stock_move_line.py index 67278c4..718d3c1 100644 --- a/stock_picking_report_valued_sale_mrp/models/stock_move_line.py +++ b/stock_picking_report_valued_sale_mrp/models/stock_move_line.py @@ -23,7 +23,7 @@ class StockMoveLine(models.Model): @api.depends("sale_line") def _compute_phantom_product_id(self): """Relate every line with its kit product""" - self.write({"phantom_product_id": False}) + self.phantom_product_id = False for line in self.filtered( lambda x: x.sale_line and x.sale_line.product_id.get_components() @@ -38,7 +38,7 @@ class StockMoveLine(models.Model): super()._compute_sale_order_line_fields() pickings = self.mapped("picking_id") kit_lines = pickings.move_line_ids.filtered("phantom_product_id") - pickings.move_line_ids.write( + pickings.move_line_ids.update( {"phantom_line": False, "phantom_delivered_qty": 0.0} ) for sale_line in kit_lines.mapped("sale_line"):