From 57835656a17ddc8b964b724c06658365f6c5f9bd Mon Sep 17 00:00:00 2001 From: KolushovAlexandr Date: Fri, 12 Apr 2019 14:51:36 +0500 Subject: [PATCH] :ambulance: clicking numbers and enter in selection popups --- pos_keyboard/__manifest__.py | 1 + pos_keyboard/doc/changelog.rst | 7 ++++--- pos_keyboard/static/src/js/pos.js | 8 +++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pos_keyboard/__manifest__.py b/pos_keyboard/__manifest__.py index de43097..4641e58 100644 --- a/pos_keyboard/__manifest__.py +++ b/pos_keyboard/__manifest__.py @@ -26,6 +26,7 @@ ], "external_dependencies": {"python": [], "bin": []}, "data": [ + "data.xml" ], "demo": [ ], diff --git a/pos_keyboard/doc/changelog.rst b/pos_keyboard/doc/changelog.rst index c965cc3..ac8ea31 100644 --- a/pos_keyboard/doc/changelog.rst +++ b/pos_keyboard/doc/changelog.rst @@ -1,7 +1,8 @@ -.. _changelog: +`1.1.2` +------- + +**Fix:** Error on clicking numbers and enter in selection popups -Updates -======= `1.1.1` ------- diff --git a/pos_keyboard/static/src/js/pos.js b/pos_keyboard/static/src/js/pos.js index b1328de..fdcc836 100644 --- a/pos_keyboard/static/src/js/pos.js +++ b/pos_keyboard/static/src/js/pos.js @@ -50,12 +50,18 @@ odoo.define('pos_keyboard.pos', function (require) { } else if (data.type === type.backspace){ this.click_keyboard('BACKSPACE'); } else if (data.type === type.enter){ - this.click_confirm(); + if (this.click_confirm.length) { + return this.click_confirm(); + } + return; } else if (data.type === type.escape){ this.click_cancel(); } }, click_keyboard: function(value){ + if (typeof this.inputbuffer === 'undefined') { + return; + } var newbuf = this.gui.numpad_input( this.inputbuffer, value,