1ae9a476831e50430720e36e1ecee6349c98a5bc
It is currently not possible to update the quantity of a product from the inventory report To reproduce the issue: 1. Create a storable product P 2. Update its on hand quantity to 100 3. Inventory > Reporting > Inventory Report 4. On the line for P, update to quantity to 75 Error: The quantity becomes 0 instead of 75 When setting the quantity from the inventory report, the client calls the `write` method with the context key `inventory_report_mode` defined and equal to `True` This `write` leads to `_set_inventory_quantity` which triggers `action_apply_inventory` (without disabling the context key!): https://github.com/odoo/odoo/blob/8b155b695823dfa954464ad0d5dd07445ece2471/addons/stock/models/stock_quant.py#L150-L158 At the end of the inventory update, it resets the field `inventory_quantity` to 0: https://github.com/odoo/odoo/blob/8b155b695823dfa954464ad0d5dd07445ece2471/addons/stock/models/stock_quant.py#L592 To do so, the `write` method is called again and here is the issue: https://github.com/odoo/odoo/blob/8b155b695823dfa954464ad0d5dd07445ece2471/addons/stock/models/stock_quant.py#L244-L248 Once `inventory_quantity` is updated, since `inventory_report_mode` is still in the context and equal to `True`, `action_apply_inventory` is called again. Then, when applying again the inventory, it will consider the value of `inventory_quantity` (i.e., `0`) to define the new quantity. OPW-2737437 OPW-2746201 closes odoo/odoo#84002 X-original-commit: 6500e99cbfda44ebd1931acd657e86841ac2342a Signed-off-by: Arnold Moyaux <arm@odoo.com> Signed-off-by: Adrien Widart <awt@odoo.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%