mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX] stock_available_mrp: Set correctlly immediately_usable_qty value.
TT27873
This commit is contained in:
@@ -57,7 +57,7 @@ class ProductProduct(models.Model):
|
|||||||
component_needs = product._get_components_needs(exploded_components)
|
component_needs = product._get_components_needs(exploded_components)
|
||||||
if not component_needs:
|
if not component_needs:
|
||||||
# The BoM has no line we can use
|
# The BoM has no line we can use
|
||||||
potential_qty = immediately_usable_qty = 0.0
|
potential_qty = 0.0
|
||||||
else:
|
else:
|
||||||
# Find the lowest quantity we can make with the stock at hand
|
# Find the lowest quantity we can make with the stock at hand
|
||||||
components_potential_qty = min(
|
components_potential_qty = min(
|
||||||
@@ -79,8 +79,7 @@ class ProductProduct(models.Model):
|
|||||||
)
|
)
|
||||||
|
|
||||||
res[product.id]["potential_qty"] = potential_qty
|
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"] = potential_qty
|
||||||
res[product.id]["immediately_usable_qty"] += immediately_usable_qty
|
|
||||||
|
|
||||||
return res, stock_dict
|
return res, stock_dict
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user