[FIX] point_of_sale: ignore TOTAlY returns

Returns were partially ignored when typing keystrokes, thanks to a return; when event which equaled 13, but the default behaviour (press on the focused input/button) was not prevented. This is now the case thanks to preventDefault. For instance, just after a discount set, the focused input was pressed and the associated value was added when scanning a new product with the scanner. Therefore, if we entered a discount of 30%, scanning a new product added '0', the last pushed button, to the discount, and then added the product.

bzr revid: dle@openerp.com-20131209145652-3g9rgnfz1w8k0whw
This commit is contained in:
Denis Ledoux 2013-12-09 15:56:52 +01:00
parent 93ab94a608
commit 3be327c0ae
1 changed files with 4 additions and 0 deletions

View File

@ -438,6 +438,10 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
// The barcode readers acts as a keyboard, we catch all keyup events and try to find a
// barcode sequence in the typed keys, then act accordingly.
this.handler = function(e){
if(e.which === 13){ //ignore returns
e.preventDefault();
return;
}
//We only care about numbers
if (e.which >= 48 && e.which < 58){