Skip to content

Commit

Permalink
[FIX] stock_available_mrp: increment potencial_qty to immediately_usa…
Browse files Browse the repository at this point in the history
…ble_qty instead of replacing it
  • Loading branch information
ACheung-FactorLibre committed Dec 9, 2024
1 parent d9f406f commit 4568a3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stock_available_mrp/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _compute_available_quantities_dict(self):
)

res[product.id]["potential_qty"] = potential_qty
res[product.id]["immediately_usable_qty"] = potential_qty
res[product.id]["immediately_usable_qty"] += potential_qty

return res, stock_dict

Expand Down
6 changes: 3 additions & 3 deletions stock_available_mrp/tests/test_potential_qty.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_02_potential_qty_no_bom_for_company(self):
company_id=chicago_id,
)
self.assertPotentialQty(
self.tmpl, 250.0, "Wrong template potential after receiving components"
self.tmpl, 500.0, "Wrong template potential after receiving components"
)

test_user = self.env["res.users"].create(
Expand Down Expand Up @@ -195,7 +195,7 @@ def test_03_potential_qty(self):
location=self.wh_main.lot_stock_id,
)
self.assertPotentialQty(
self.tmpl, 250.0, "Wrong template potential after receiving components"
self.tmpl, 500.0, "Wrong template potential after receiving components"
)
self.assertPotentialQty(
self.var1, 250.0, "Wrong variant 1 potential after receiving components"
Expand Down Expand Up @@ -450,4 +450,4 @@ def test_product_phantom(self):
move_in._action_confirm()
product.invalidate_model()

self.assertEqual(product.immediately_usable_qty, 0.0)
self.assertEqual(product.immediately_usable_qty, 1.0)

0 comments on commit 4568a3f

Please sign in to comment.