Skip to content
Snippets Groups Projects
Commit 673a6b69 authored by anhe-odoo's avatar anhe-odoo
Browse files

[FIX] stock_account: don't update inventory valuation for negative quantity


Expected Behaviour

When updating the cost of a product with a negative quantity and then
making an inventory adjustment, the final value should be corrected according
to the current cost of the product

Observed Behaviour

In the case we had a negative quantity when changing the cost, the compensation
layer will be ignored when doing an inventory adjustment afterward, leading to
an incorrect total value in the inventory valuation

Reproducibility

This bug can be reproduced following these steps:
- Create Storable product with costing method = AVCO Automated, Update cost to 100$
- Sell 10 units of this product (Inventory valuation at -1000 $ for -10 units)
- Update cost of the product to 10 $ (Inventory valuation at -100 $ for -10 units)
- Create an inventory adjustment to set the quantity of the product to 0.
==> Inventory valuation is a 900 $ for 0 unit of our product

Related Issues/PR

- opw-2635692

closes odoo/odoo#86328

X-original-commit: 2e4fdcb8
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
Signed-off-by: default avatarHendrickx Anthony (anhe) <anhe@odoo.com>
parent 8ece0413
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment