From f3307e201c0f476b1bd838676190c307b88fb5b2 Mon Sep 17 00:00:00 2001 From: yhu-odoo Date: Thu, 17 Jun 2021 14:59:26 +0000 Subject: [PATCH] [FIX] mrp: skip service when compute kit quantities Since we can't transfer service product, when compute delivered or received kit quantities, we should skip the service components. Task-2566373 PR #72306 closes odoo/odoo#72575 X-original-commit: f86c7c0dfa09a2136ed1789a905eae9205de0c03 Signed-off-by: Arnold Moyaux --- addons/mrp/models/stock_move.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index a5c22dc7a0f..5ba43f930f3 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -363,6 +363,9 @@ class StockMove(models.Model): qty_ratios = [] boms, bom_sub_lines = kit_bom.explode(product_id, kit_qty) for bom_line, bom_line_data in bom_sub_lines: + # skip service since we never deliver them + if bom_line.product_id.type == 'service': + continue bom_line_moves = self.filtered(lambda m: m.bom_line_id == bom_line) if bom_line_moves: if float_is_zero(bom_line_data['qty'], precision_rounding=bom_line.product_uom_id.rounding):