Skip to content
Snippets Groups Projects
Commit 75bb9886 authored by Tom De Caluwé's avatar Tom De Caluwé Committed by Arnold Moyaux
Browse files

[FIX] stock_account: avoid negative values after revaluation


When performing a manual stock revaluation, the value difference is distributed
equally among the available stock. This method breaks down however in case of a
devaluation where some items in stock are already valued less than the unit
cost difference: this results in a negative value.

This commit will prevent such devaluations by raising a UserError whenever the
remaining value of a stock.valuation.layer becomes negative. Additionally, after
a revaluation, the standard_price field will now also be updated for fifo valued
products.

opw-3340298

closes odoo/odoo#126157

Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
parent 876d1a21
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