diff --git a/stock_available/models/product_template.py b/stock_available/models/product_template.py index 945f0c541..1483f8a8b 100644 --- a/stock_available/models/product_template.py +++ b/stock_available/models/product_template.py @@ -27,13 +27,15 @@ class ProductTemplate(models.Model): res = {} for template in self: immediately_usable_qty = sum( - [variants_dict[p.id]["immediately_usable_qty"] for p in + [variants_dict[p.id]["immediately_usable_qty"] - + variants_dict[p.id]["potential_qty"] for p in template.product_variant_ids]) potential_qty = max( [variants_dict[p.id]["potential_qty"] for p in template.product_variant_ids] or [0.0]) res[template.id] = { - "immediately_usable_qty": immediately_usable_qty, + "immediately_usable_qty": immediately_usable_qty + + potential_qty, "potential_qty": potential_qty, } return res