[FIX] stock_available_mrp: Set correctlly immediately_usable_qty value.

TT27873
This commit is contained in:
Víctor Martínez
2022-02-22 14:20:14 +01:00
parent 0f52c574cb
commit 29a63ae105

View File

@@ -57,7 +57,7 @@ class ProductProduct(models.Model):
component_needs = product._get_components_needs(exploded_components)
if not component_needs:
# The BoM has no line we can use
potential_qty = immediately_usable_qty = 0.0
potential_qty = 0.0
else:
# Find the lowest quantity we can make with the stock at hand
components_potential_qty = min(
@@ -79,8 +79,7 @@ class ProductProduct(models.Model):
)
res[product.id]["potential_qty"] = potential_qty
immediately_usable_qty = potential_qty if bom_id.type != "phantom" else 0
res[product.id]["immediately_usable_qty"] += immediately_usable_qty
res[product.id]["immediately_usable_qty"] = potential_qty
return res, stock_dict