mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Make stock_available_mrp compatible with other modules like stock_available_immediately
This commit is contained in:
committed by
ps-tubtim
parent
a0f835afe0
commit
29dfe25d3f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user