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-28 10:22:07 +00:00
2023-09-19 16:37:09 +00:00
2023-09-28 18:20:22 +00:00
2023-09-23 21:08:01 +00:00
2023-09-19 16:37:09 +00:00
2023-09-27 17:41:04 +00:00
2023-09-29 09:21:51 +00:00
2023-09-29 09:21:51 +00:00
2023-09-18 10:13:59 +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-28 16:57:55 +00:00
2023-09-14 11:22:47 +00:00
2023-09-27 07:28:11 +00:00
2023-09-25 11:30:15 +00:00
2023-09-21 16:52:10 +00:00
2023-09-23 10:33:04 +00:00
2023-09-28 16:57:55 +00:00
2023-09-28 11:56:54 +00:00
2023-09-14 11:22:47 +00:00
2023-09-19 16:37:03 +00:00
2023-09-28 18:20:19 +00:00
2023-09-29 13:11:50 +00:00
2023-09-27 17:40:55 +00:00
2023-09-27 17:40:55 +00:00
2023-09-27 17:40:55 +00:00
2023-09-27 17:40:55 +00:00
2023-09-29 10:41:50 +00:00
2023-09-22 11:55:51 +00:00
2023-09-28 15:48:22 +00:00
2023-09-15 09:22:04 +00:00
2023-09-28 15:48:23 +00:00
2023-09-28 01:51:37 +00:00
2023-09-28 16:57:55 +00:00
2023-09-27 14:57:01 +00:00
2023-09-26 09:32:33 +00:00
2023-09-29 13:11:50 +00:00
2023-09-25 15:20:19 +00:00
2023-09-21 07:40:04 +00:00
2023-09-28 13:21:01 +00:00
2023-09-26 09:32:27 +00:00
2023-09-28 11:56:53 +00:00
2023-09-28 01:51:25 +00:00
2023-09-28 15:48:27 +00:00
2023-09-28 03:19:06 +00:00
2023-09-28 16:57:55 +00:00
2023-09-28 15:48:22 +00:00
2023-09-18 10:14:12 +00:00
2023-09-22 13:32:53 +00:00
2023-09-20 10:02:07 +00:00
2023-09-28 09:04:08 +00:00
2023-09-14 17:07:58 +00:00
2023-09-27 21:24:19 +00:00
2023-09-28 15:48:27 +00:00
2023-09-18 22:17:08 +00:00
2023-09-26 09:32:27 +00:00
2023-09-26 09:32:27 +00:00
2023-09-19 08:48:25 +00:00
2023-09-28 03:19:06 +00:00
2023-09-27 09:11:47 +00:00
2023-09-18 10:14:12 +00:00
2023-09-29 01:02:06 +00:00
2023-09-13 16:39:46 +00:00
2023-09-20 13:03:11 +00:00
2023-09-20 08:36:42 +00:00
2023-09-29 13:11:52 +00:00
2023-09-19 16:37:09 +00:00
2023-09-19 16:37:09 +00:00
2023-09-21 23:54:32 +00:00
2023-09-18 22:17:08 +00:00
2023-09-20 13:03:07 +00:00
2023-09-19 08:48:36 +00:00
2023-09-18 10:14:12 +00:00
2023-09-18 10:14:12 +00:00
2023-09-28 15:48:27 +00:00
2023-09-18 10:14:12 +00:00
2023-09-26 17:09:58 +00:00
2023-09-27 09:11:47 +00:00
2023-09-18 10:14:12 +00:00
2023-09-18 10:14:12 +00:00
2023-09-28 04:17:25 +00:00
2023-09-18 10:14:12 +00:00
2023-09-27 14:57:03 +00:00
2023-09-29 13:11:50 +00:00
2023-09-27 11:33:01 +00:00
2023-09-28 01:51:23 +00:00
2023-09-27 14:57:03 +00:00
2023-09-18 22:17:04 +00:00
2023-09-18 22:17:04 +00:00
2023-09-18 22:17:04 +00:00
2023-09-15 20:34:30 +00:00
2023-09-21 16:52:10 +00:00
2023-09-28 07:50:09 +00:00
2023-09-29 11:59:01 +00:00
2023-09-27 17:40:59 +00:00
2023-09-27 11:33:01 +00:00
2023-09-20 10:02:05 +00:00
2023-09-27 11:33:00 +00:00
2023-09-13 12:19:04 +00:00
2023-09-29 08:07:00 +00:00
2023-09-27 11:33:01 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-27 11:33:01 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-29 08:07:00 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-22 13:32:53 +00:00
2023-09-29 08:07:00 +00:00
2023-09-29 11:59:03 +00:00
2023-09-28 16:57:55 +00:00
2023-09-27 11:33:01 +00:00
2023-09-13 15:34:29 +00:00
2023-09-28 07:50:06 +00:00
2023-09-27 09:11:47 +00:00
2023-09-23 21:08:01 +00:00
2023-09-25 13:09:08 +00:00
2023-09-27 14:57:15 +00:00
2023-09-29 11:59:01 +00:00
2023-09-28 16:57:55 +00:00
2023-09-25 13:09:08 +00:00
2023-09-28 16:57:55 +00:00
2023-09-28 10:22:03 +00:00
2023-09-29 13:11:56 +00:00
2023-09-29 13:11:50 +00:00
2023-09-28 01:51:23 +00:00
2023-09-21 20:38:01 +00:00
2023-09-26 09:32:27 +00:00
2023-09-27 14:57:05 +00:00
2023-09-28 10:22:03 +00:00
2023-09-25 09:38:39 +00:00
2023-09-28 10:22:03 +00:00
2023-09-21 05:23:26 +00:00
2023-09-25 09:38:37 +00:00
2023-09-26 09:32:27 +00:00
2023-09-28 18:20:19 +00:00
2023-09-14 17:07:59 +00:00
2023-09-28 18:20:19 +00:00
2023-09-29 11:59:01 +00:00
2023-09-28 16:57:55 +00:00
2023-09-29 09:21:53 +00:00
2023-09-29 11:59:01 +00:00
2023-09-29 11:59:01 +00:00
2023-09-27 14:57:06 +00:00
2023-09-29 13:11:50 +00:00
2023-09-29 08:07:04 +00:00
2023-09-28 01:51:27 +00:00
2023-09-27 17:40:55 +00:00
2023-09-25 15:20:16 +00:00
2023-09-28 03:19:17 +00:00
2023-09-29 13:11:56 +00:00
2023-09-28 13:20:58 +00:00
2023-09-27 09:11:44 +00:00
2023-09-15 12:15:14 +00:00
2023-09-29 11:59:01 +00:00
2023-09-27 11:33:01 +00:00
2023-09-28 01:51:33 +00:00
2023-09-27 17:40:55 +00:00
2023-09-29 13:11:50 +00:00
2023-09-19 16:37:13 +00:00
2023-09-29 08:07:04 +00:00
2023-09-19 16:37:13 +00:00
2023-09-27 11:33:01 +00:00
2023-09-14 11:22:52 +00:00
2023-09-29 09:21:51 +00:00
2023-09-29 13:11:53 +00:00
2023-09-27 11:33:01 +00:00
2023-09-29 11:59:06 +00:00
2023-09-29 09:21:55 +00:00
2023-09-25 17:11:31 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 17:40:55 +00:00
2023-09-27 17:40:55 +00:00
2023-09-27 17:40:55 +00:00
2023-09-14 18:09:48 +00:00
2023-09-28 16:57:55 +00:00
2023-09-27 11:33:01 +00:00
2023-09-15 20:34:28 +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-20 11:34:07 +00:00
2023-09-28 16:57:55 +00:00
2023-09-20 11:34:07 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 13:11:58 +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-28 10:22:05 +00:00
2023-09-29 13:11: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
2023-09-27 11:33:01 +00:00
2023-09-22 13:32:53 +00:00
2023-09-27 11:33:01 +00:00
2023-09-14 18:09:48 +00:00
2023-09-27 11:33:01 +00:00
2023-09-14 18:09:48 +00:00
2023-09-27 11:33:01 +00:00
2023-09-28 16:57:55 +00:00
2023-09-27 11:33:01 +00:00
2023-09-27 11:33:01 +00:00