mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX] - local variable referenced before assignment
This commit is contained in:
@@ -95,21 +95,21 @@ class ProductProduct(models.Model):
|
||||
for component, need in component_needs.items()
|
||||
]
|
||||
)
|
||||
|
||||
bom_id = product.bom_id
|
||||
potential_qty = bom_id.product_qty * components_potential_qty
|
||||
potential_qty = product.bom_id.product_qty * components_potential_qty
|
||||
potential_qty = potential_qty > 0.0 and potential_qty or 0.0
|
||||
|
||||
# We want to respect the rounding factor of the potential_qty
|
||||
# Rounding down as we want to be pesimistic.
|
||||
potential_qty = bom_id.product_uom_id._compute_quantity(
|
||||
potential_qty = product.bom_id.product_uom_id._compute_quantity(
|
||||
potential_qty,
|
||||
product.bom_id.product_tmpl_id.uom_id,
|
||||
rounding_method="DOWN",
|
||||
)
|
||||
|
||||
res[product.id]["potential_qty"] = potential_qty
|
||||
immediately_usable_qty = potential_qty if bom_id.type != "phantom" else 0
|
||||
immediately_usable_qty = (
|
||||
potential_qty if product.bom_id.type != "phantom" else 0
|
||||
)
|
||||
res[product.id]["immediately_usable_qty"] += immediately_usable_qty
|
||||
|
||||
return res, stock_dict
|
||||
|
||||
Reference in New Issue
Block a user