summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Caburnay <jcb@odoo.com>2021-05-25 09:05:39 +0000
committerJoseph Caburnay <jcb@odoo.com>2021-05-25 09:44:54 +0000
commita37935b466e3d74e08d5ea41047185144e8e5b6f (patch)
treefd985f4dc66a4672df30442c54b4f6118ddb99ca
parent965c67cb16d2a4ac10d35a01da3af311867a47e6 (diff)
[FIX] point_of_sale: dot input should be recognized even at different lang
Language such as FR recognizes `,` as the decimal separator. However, it is possible that the keyboard setting is American so the decimal point in the numpad will send `.` when pressing it. POS should be able to recognize both. This fix allows `.` sent from keyboard to be interpreted as decimal separator even at language where the decimal separator is `,`. This is okay because number inputs in POS doesn't take into account the thousand separator.
-rw-r--r--addons/point_of_sale/static/src/js/Misc/NumberBuffer.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/point_of_sale/static/src/js/Misc/NumberBuffer.js b/addons/point_of_sale/static/src/js/Misc/NumberBuffer.js
index f5f38d9cb00..8e25f601432 100644
--- a/addons/point_of_sale/static/src/js/Misc/NumberBuffer.js
+++ b/addons/point_of_sale/static/src/js/Misc/NumberBuffer.js
@@ -226,7 +226,7 @@ odoo.define('point_of_sale.NumberBuffer', function(require) {
};
if (input === undefined || input === null) return;
let isFirstInput = isEmpty(this.state.buffer);
- if (input === this.decimalPoint) {
+ if (input === ',' || input === '.') {
if (isFirstInput) {
this.state.buffer = '0' + this.decimalPoint;
} else if (!this.state.buffer.length || this.state.buffer === '-') {