From da9275abdee5a8f184ce39ae2e9fb736b49dd151 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Thu, 17 Dec 2015 09:49:01 +0100 Subject: [PATCH] [FIX] point_of_sale: use correct decimal separator for payment amounts In some places '.' was hardcoded as a decimal separator. Because now payment amounts now get passed through web.parse_value() this causes issues when the the decimal separator is not '.'. opw-660024 --- addons/point_of_sale/static/src/js/gui.js | 7 ++++--- addons/point_of_sale/static/src/js/screens.js | 2 +- addons/point_of_sale/static/src/xml/pos.xml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/static/src/js/gui.js b/addons/point_of_sale/static/src/js/gui.js index 6ae8397fd3e..1557c2af230 100644 --- a/addons/point_of_sale/static/src/js/gui.js +++ b/addons/point_of_sale/static/src/js/gui.js @@ -314,14 +314,15 @@ 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 decimal_point = instance.web._t.database.parameters.decimal_point; - if (input === '.') { + if (input === decimal_point) { if (options.firstinput) { newbuf = "0."; }else if (!newbuf.length || newbuf === '-') { newbuf += "0."; - } else if (newbuf.indexOf('.') < 0){ - newbuf = newbuf + '.'; + } else if (newbuf.indexOf(decimal_point) < 0){ + newbuf = newbuf + decimal_point; } } else if (input === 'CLEAR') { newbuf = ""; diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 68ce5aa9180..24de92cd923 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1482,7 +1482,7 @@ openerp.point_of_sale.load_screens = function load_screens(instance, module){ // } else if ( event.keyCode === 190 || // Dot event.keyCode === 110 || // Decimal point (numpad) event.keyCode === 188 ) { // Comma - key = '.'; + key = self.decimal_point; } else if ( event.keyCode === 46 ) { // Delete key = 'CLEAR'; } else if ( event.keyCode === 8 ) { // Backspace diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 4fe8863c019..b2314424144 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -544,7 +544,7 @@
- +