[FIX] stock_account: fix rounding adjustment
This fix (odoo/odoo#46850) was too permissive and fix too much
stock valuation issues (other than rounding error) under the hood.
The problem of the "too permissive" is will hide some errors
without get any feedback about them. Also, it changes the SVL value
without any explanation.
To avoid the first issue, apply a threshold on the rounding adjustment.
This threshold is '(quantity_out * smallest_value_of_the_currency) / 2'
(`smallest_value_of_the_currency` = `rounding` field of the related
currency).
Also to improve debugging, add a line in the description
about the rounding adjustment done in a SVL
task-2452786
closes odoo/odoo#65567
Signed-off-by:
William Henrotin <Whenrow@users.noreply.github.com>
Showing
- addons/stock_account/models/product.py 17 additions, 7 deletionsaddons/stock_account/models/product.py
- addons/stock_account/models/stock_move.py 1 addition, 0 deletionsaddons/stock_account/models/stock_move.py
- addons/stock_account/tests/test_stockvaluationlayer.py 19 additions, 2 deletionsaddons/stock_account/tests/test_stockvaluationlayer.py
Loading
Please register or sign in to comment