summaryrefslogtreecommitdiff
path: root/addons/link_tracker
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-04-22 07:53:28 +0000
committerNicolas Martinelli <nim@odoo.com>2020-04-22 13:00:06 +0000
commitd5ecad2a36002558b25ee33633774e85ecaed668 (patch)
tree17c0460c8d9b5ed77c660b28cd7889947f7a5cb1 /addons/link_tracker
parent51d36ca373350245f32133b7d4ea0a592c9fdcf2 (diff)
[FIX] sale_stock: package with decimal values
Follow-up of f1e79c74a5c07d6be3154629f6f381ebaf907fb1 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#49983 X-original-commit: 3d48e2b49023eaf1b1dd0c8cb2b7723e41924a38 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/link_tracker')
0 files changed, 0 insertions, 0 deletions