From b04d78000f93e7b6ce6ea1da1b3efa8faf07fc31 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 18 Feb 2019 09:46:38 +0000 Subject: [PATCH] [FIX] point_of_sale: barcode and ENTER key - Set a barcode for a product A - Open the POS interface - Click on a product B => it is added to the order - Scan product A Product A is added to the order, but a unit of B is also added. Commit 9de1bc0eef6f5bfaa2 introduced keyboard shortcuts in the POS interface. In particular, when a product is selected, pressing the SPACE or the ENTER key adds it in the order. Since the barcode scanner sends an ENTER key as a final character, it triggers the addition of both products. opw-1934520 closes odoo/odoo#31185 --- addons/point_of_sale/static/src/js/screens.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index aac23b1ebb8..19a48e76aaf 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -842,8 +842,8 @@ var ProductListWidget = PosBaseWidget.extend({ }; this.keypress_product_handler = function(ev){ - if (ev.which != 13 && ev.which != 32) { - // Key is not space or enter + // React only to SPACE to avoid interfering with warcode scanner which sends ENTER + if (ev.which != 32) { return; } ev.preventDefault();