From 682e66043ffe744752587906467c15d90b07203f Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Thu, 17 Dec 2015 13:28:58 +0100 Subject: [PATCH] [FIX] point_of_sale: fix the +10, +20 and +50 buttons Because we now correctly format numbers, we have to parse the number strings with web.parse_value(), then calculate the new amount and then convert them back to a correctly formatted number string. --- addons/point_of_sale/static/src/js/gui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/gui.js b/addons/point_of_sale/static/src/js/gui.js index 1557c2af230..cd296b6dd4a 100644 --- a/addons/point_of_sale/static/src/js/gui.js +++ b/addons/point_of_sale/static/src/js/gui.js @@ -314,6 +314,7 @@ openerp.point_of_sale.load_gui = function load_gui(instance, module) { numpad_input: function(buffer, input, options) { var options = options || {}; var newbuf = buffer.slice(0); + var newbuf_float = instance.web.parse_value(newbuf, {type: "float"}, 0); var decimal_point = instance.web._t.database.parameters.decimal_point; if (input === decimal_point) { @@ -339,7 +340,7 @@ openerp.point_of_sale.load_gui = function load_gui(instance, module) { newbuf = '-' + newbuf; } } else if (input[0] === '+' && !isNaN(parseFloat(input))) { - newbuf = '' + ((parseFloat(newbuf) || 0) + parseFloat(input)); + newbuf = this.chrome.format_currency_no_symbol(newbuf_float + parseFloat(input)); } else if (!isNaN(parseInt(input))) { if (options.firstinput) { newbuf = '' + input;