97a8d725e44399d14806b2d15e023094d691a0f7
When selling a tracked product, if the latter has already been sold
once, the source location of the associated stock move will be
incorrect.
To reproduce the error:
1. Create a product P
- Product Type: Storable Product
- Available in POS: True
- Inventory: By Lots
2. Update P's quantity > 0 with lot L
3. Start POS session
4. Sell one P with lot L (Register payment + Validate)
5. Repeat 4
6. Go to Inventory > Reporting > Product Moves and apply one filter:
- Product: P
Error: There are 3 product moves:
- One from Inventory adjustment to Stock
- One from Stock to Customers
- One from Customers to Customers
The third one is incorrect and should be from Stock to Customers.
Because of the first sale, a `stock.quant` is created and indicates that
one P from lot L is at location "Customers". When selling the second
one, because of the OR-condition, this `stock.quant` is selected. The
condition should be an AND-condition.
This fix is an improvement of #69750. The new test checks the above flow
and the one described in the related PR.
closes #71435
closes odoo/odoo#71573
closes odoo/odoo#75265
X-original-commit: e0921851a1f1a636169e62f47b4d4c32255f98ed
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
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
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%