From 6bc3b30371db2bbdcab80b8e589a6ebd1e78d563 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 5 May 2020 14:15:14 +0000 Subject: [PATCH] [FIX] mrp: Sub BoM - Create products P1 & P2 - Create a BOM for P1 Operation O1 - Create a BOM for P2 Use 1 unit of P1 Operation O2 - Open the 'Structure & Cost' report for P2 The BOM of P1 is not taken into account in the report. This happens because a 'Sub BoM' must have the same Operation than the parent (or no operation set). There is no real functional reason for this, so we remove the limitation. opw-2246370 closes odoo/odoo#50743 X-original-commit: 5d3e88aa919a69ad54076637e72b880552e2a0be Signed-off-by: Nicolas Martinelli (nim) --- addons/mrp/models/mrp_bom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/mrp/models/mrp_bom.py b/addons/mrp/models/mrp_bom.py index b10a5757651..cbd86e6c6fa 100644 --- a/addons/mrp/models/mrp_bom.py +++ b/addons/mrp/models/mrp_bom.py @@ -310,8 +310,7 @@ class MrpBomLine(models.Model): else: line.child_bom_id = self.env['mrp.bom']._bom_find( product_tmpl=line.product_id.product_tmpl_id, - product=line.product_id, - picking_type=line.bom_id.picking_type_id) + product=line.product_id) @api.depends('product_id') def _compute_attachments_count(self):