[FIX] mrp: can't provide bom when _get_lead_deys
In _get_lead_days, it always try to use the first bom of the product.
After 6825c44, days_to_prepare_mo is moved from product to bom. To
correctly calculet the lead days, we sometimes need to provide the bom.
Make this possible in this commit.
Task-3078049
closes odoo/odoo#121813
X-original-commit: cbbd370eb653e0023d1173039787055590ba680b
Related: odoo/enterprise#41256
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
This commit is contained in:
@@ -198,7 +198,7 @@ class StockRule(models.Model):
|
||||
if not manufacture_rule:
|
||||
return delay, delay_description
|
||||
manufacture_rule.ensure_one()
|
||||
bom = (product.variant_bom_ids or product.bom_ids)[:1]
|
||||
bom = values.get('bom') or (product.variant_bom_ids or product.bom_ids)[:1]
|
||||
manufacture_delay = bom.produce_delay
|
||||
delay += manufacture_delay
|
||||
if not bypass_delay_description:
|
||||
|
||||
Reference in New Issue
Block a user