summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGert Pellin <gpe@odoo.com>2019-03-25 10:45:44 +0000
committerGert Pellin <gpe@odoo.com>2019-04-09 09:39:03 +0000
commit41137c304fe4d3b166391a8f0636c621fb358fa7 (patch)
tree8171d13c606ab710453d4b04073cee375fe328a6
parent6431e366a8e29e367d1908177b706bd8418d9d41 (diff)
[FIX] point_of_sale: fix decimal point
Before this fix there was no check if there was already a decimal point in the value when using the onscreen keypad. Fixes #32034 Steps to reproduce: * Open up POS interface * Add an item * Press the decimal point button multiple times (2 or more) * Note that pressing additional number keys do not display * Backspace must be pressed for the number of digits entered, plus the multiple decimal points, to clear all the hidden characters in the value buffer * Same behavior occurs with the Discount and Price values Current behavior: Multiple decimal point characters can be "entered" and are inserted into value buffer (Qty, Disc, or Price), but do not display on screen. Additional digits entered after multiple decimal point presses are inserted into buffer, but do not display on screen. Additional digits entered after the last valid digit on the screen are also inserted into the buffer. Backspace must be used to remove the invisible characters from the value buffer. Expected behavior: The value buffer for Qty, Disc, or Price should more closely match what is displayed on the screen. Characters which are invalid and aren't displayed on the screen, should not be inserted into the value buffer, including the decimal point button. closes odoo/odoo#32089 Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
-rw-r--r--addons/point_of_sale/static/src/js/models.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 5e00712be0d..795597574a3 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -2350,7 +2350,7 @@ exports.NumpadState = Backbone.Model.extend({
this.set({
buffer: "-" + newChar
});
- } else {
+ } else if (!(newChar === '.') || oldBuffer.indexOf('.') === -1) {
this.set({
buffer: (this.get('buffer')) + newChar
});