[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 <amoyaux@users.noreply.github.com>
This commit is contained in:
yhu-odoo
2021-06-28 07:16:55 +00:00
parent c56ba2949e
commit f3307e201c
+3
View File
@@ -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):