-
- Downloads
[FIX] website_sale_stock: use correct qty to show warning/error
Without this commit, if you had: - 3 Qty for product P in WH1 - 10 Qty for product P in WH2 - no warehouse set on website - set show stock and prevent sales if not enough stock enabled And then: - Add 3 P in your cart - In cart, add more P, it would let you do it, while it shouldn't You would then be stuck on payment step as it would tell you only 3 are available. This commit improves 6b05fb2b by ensuring the warehouse_id used is the correct one (the one that will be used on the SO (required field)). That commit was fixing a case that was not supposed to happen[1], it is that case that should have been fixed (which is fixed by previous commit of this PR) [1]: it would fix the 'issue' when you add a product which has no stock available for the warehouse that will be used when creating the SO, by letting you through the warning, but you would then be stuck on the payment step as the qty check would be correctly done. The fix should have been to display the correct qty and prevent the add to cart in that case. closes odoo/odoo#77308 Signed-off-by:Romain Derie (rde) <rde@odoo.com> Co-authored-by:
Romain Derie <rde@odoo.com> Co-authored-by:
Adrien Widart <awt@odoo.com>
Please register or sign in to comment