Files
odoo_source/addons
David (dafr) 1da26ab27d [FIX] stock,product_expiry: Add 'with_expiration' context to _get_available_quantity
This commit fix 3 issues with the reservation with use_expiration_date set on the product:

1) -- Discrepancy of available_quantity --
StockMove._update_reserved_quantity() works along StockMove._get_available_quantity()
If the with_expiration context is added to one and not the other, the available_quantity sent to the 'update' method will not be correct.

2) -- Can't reserve on imperishable quants --
On the Quant, if expiration_date is False, the reservation will not be possible.
Changed the domain from `expiration_date >= date` to `expiration is False or expiration_date >= date`

---

# How to Reproduce
 - Create a product P, tracked by lot, with use_expiration_date = True
 - Set quantity on hand to 10 (without lot)
 - Create a Sale Order for 1 unit of P: Confirm
 - On the Delivery, 'Check Availability' (if not done automatically)
 => The Transfer is marked as Ready (aka: at least 1 unit reserved), but nothing is reserved.
 => If you Unreserve, the product availability is shown as Available, and if your Reserve again, it is shown as 'Not Available'

 OPW-3434996

closes odoo/odoo#137097

X-original-commit: b5463465fa877b9913eb9747869aae00c6b394ca
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: David Fesquet (dafr) <dafr@odoo.com>
2023-09-29 13:11:56 +00:00
..
2023-09-27 11:33:01 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 17:40:55 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 11:33:01 +00:00
…
…
2023-09-29 09:21:51 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 17:40:55 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 11:33:01 +00:00