[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) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-05-06 11:14:35 +00:00
parent 06c0600ba9
commit 6bc3b30371
+1 -2
View File
@@ -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):