[FIX] point_of_sale: Spanish decimalSeparator

Current behavior:
When using spanish language in PoS the "," decimal separator was ignored

Steps to reproduce:
- Create a sale order with a discount
- Change profile language in spanish
- Open PoS and load the order created before in the PoS
- The discount is not correct, for example 18.2 will become 100

opw-2718260

closes odoo/odoo#82593

X-original-commit: ac4d985c35109b82df4f095bfe84627b290d185d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
This commit is contained in:
roen-odoo
2022-01-12 15:49:16 +00:00
parent e9bc5b9f36
commit 6a46d5e50a
+1 -1
View File
@@ -1930,7 +1930,7 @@ exports.Orderline = Backbone.Model.extend({
},
// sets a discount [0,100]%
set_discount: function(discount){
var parsed_discount = isNaN(parseFloat(discount)) ? 0 : field_utils.parse.float('' + discount);
var parsed_discount = typeof(discount) === 'number' ? discount : isNaN(parseFloat(discount)) ? 0 : field_utils.parse.float('' + discount);
var disc = Math.min(Math.max(parsed_discount || 0, 0),100);
this.discount = disc;
this.discountStr = '' + disc;