mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_multi_level: Get BoM to explode
When exploding requirements or calculating supply method, we will consider the first active BoM taking into account the routes.
This commit is contained in:
committed by
JasminSForgeFlow
parent
5db0c8edf6
commit
784e40e8fc
@@ -205,11 +205,12 @@ class ProductMRPArea(models.Model):
|
||||
break
|
||||
rule = new_rule
|
||||
# Determine the supply method based on the final rule.
|
||||
boms = rec.product_id.product_tmpl_id.bom_ids.filtered(
|
||||
lambda x: x.type in ["normal", "phantom"]
|
||||
)
|
||||
rec.supply_method = (
|
||||
"phantom"
|
||||
if rule.action == "manufacture"
|
||||
and rec.product_id.product_tmpl_id.bom_ids
|
||||
and rec.product_id.product_tmpl_id.bom_ids[0].type == "phantom"
|
||||
if rule.action == "manufacture" and boms and boms[0].type == "phantom"
|
||||
else rule.action
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user