odoo/odoo#197552

Created by fw-bot
Merged at a6451948c1f5c5c0d0baa98f39cd197a5de7d8ab

Statuses:

label
odoo-dev:saas-18.1-17.0-stock_account-fix-svl-rounding-loug-415906-fw
head
ddc1d3e3eca5bcb5e447f333da36f8767a3bfd39
merged
8 months ago by Training, Louis Gobert (loug)
odoo/odoo
17.0 #197499
saas-17.4 #197543
18.0 #197549
saas-18.1 #197552
saas-18.2
saas-18.3
saas-18.4
19.0
master #197554

[FW][FIX] stock_account: resolve SVL rounding issue

Problem with stock valuation rounding.

Steps to reproduce:
- Create a product with automated valuation in AVCO
- Set the product cost to 16.83
- Update the quantity to 10
- Make a purchase order with this product: quantity 10 and unit price 20
- Receive the product
- On the product, reduce the quantity to: 10 (-10), then 1 (-9), then 0 (-1)
- Check the valuation, it will remain -0.05 with a quantity of 0

This commit improves the previous commit:
795ce67 by using float_compare to check if the rounding error should be considered a rounding issue.

opw-4387534

Forward-Port-Of: #197499