Romain DerieandAdrien Widart e5a77f2cc1 [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 6b05fb2b21a3 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#78045

X-original-commit: 5f74b84f67222147b2eb7caadb2d831a059aae4e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Adrien Widart <awt@odoo.com>
2021-10-11 09:02:32 +00:00
2021-09-16 07:17:40 +00:00
…
…
…
…
2021-10-07 17:59:53 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%