-
- Downloads
[FIX] sale_stock: package with decimal values
Follow-up of f1e79c74 The issue still arises with: 8 % 1.6 = 1.5999999999999996 The modulo operator on float doesn't seem reliable for our use case, therefore we use a combination of `float_round` and `float_compare` to verify the quantity sold is a multiple of the quantity per package. The rounding threshold is 0.01, meaning that the warning might not be raised for some specific configurations. For example, 8.005 units with a package of 1.6 won't return a warning. Since this is a non-blocking warning, this should be enough for most cases. opw-2241985 closes odoo/odoo#49962 X-original-commit: 3d48e2b4 Signed-off-by:Nicolas Martinelli (nim) <nim@odoo.com>
Loading
Please register or sign in to comment