Skip to content
Snippets Groups Projects
Commit f8046fb7 authored by Andrea Grazioso (agr-odoo)'s avatar Andrea Grazioso (agr-odoo)
Browse files

[FIX] pos_discount: correctly get discount amount


Activate a language which has comma as decimal separator
Go into POS settings, activate 'Global Discount'.
Open POS session, add some product and use global discount.
Input some number with decimals and confirm.
Discount will be not applied

This occur because of javascript type coercion:
 Math.min(100, "11.0") -> 11
 Math.min(100, "11,0") -> NaN

So in locales with thousands separator the statement would produce
different results. Forcing float parsing fix the issue

opw-2243482

closes odoo/odoo#50558

Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent 6e99a895
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