diff --git a/addons/purchase_stock/models/purchase.py b/addons/purchase_stock/models/purchase.py index a3db07965a6..18222c3e8b5 100644 --- a/addons/purchase_stock/models/purchase.py +++ b/addons/purchase_stock/models/purchase.py @@ -255,7 +255,9 @@ class PurchaseOrderLine(models.Model): for line in self: if line.qty_received_method == 'stock_moves': total = 0.0 - for move in line.move_ids: + # In case of a BOM in kit, the products delivered do not correspond to the products in + # the PO. Therefore, we can skip them since they will be handled later on. + for move in line.move_ids.filtered(lambda m: m.product_id == line.product_id): if move.state == 'done': if move.location_dest_id.usage == "supplier": if move.to_refund: