diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-01-31 12:41:31 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2018-01-31 13:47:17 +0100 |
| commit | 513fad42a0bdebd5378fb9472bc7084e91435884 (patch) | |
| tree | b8521fdf5afd9797c05f585f77e5c847ffbebce9 /addons/barcodes/static/src/js | |
| parent | d295b4360db93a0d3333153098e623e573ac099b (diff) | |
[FIX] barcodes: delay between keys
In order to detect if a barcode scanner is being used, we detect the
delay between keypresses. The value is hardcoded to 55 ms. However, in
the case of a bluetooth scanner, this delay is often not enough,
resulting in an incorrect capture of the barcode.
We add the config parameter `barcode.max_time_between_keys_in_ms` which
allows the user to fine tune this delay for his hardware.
opw-806398
Diffstat (limited to 'addons/barcodes/static/src/js')
| -rw-r--r-- | addons/barcodes/static/src/js/barcode_events.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/barcodes/static/src/js/barcode_events.js b/addons/barcodes/static/src/js/barcode_events.js index 0adff5f8e1b..bff05aa4636 100644 --- a/addons/barcodes/static/src/js/barcode_events.js +++ b/addons/barcodes/static/src/js/barcode_events.js @@ -2,6 +2,7 @@ odoo.define('barcodes.BarcodeEvents', function(require) { "use strict"; var core = require('web.core'); +var session = require('web.session'); var mixins = core.mixins; @@ -26,7 +27,7 @@ var BarcodeEvents = core.Class.extend(mixins.PropertiesMixin, { suffix: /[\n\r\t]+/, // Keys from a barcode scanner are usually processed as quick as possible, // but some scanners can use an intercharacter delay (we support <= 50 ms) - max_time_between_keys_in_ms: 55, + max_time_between_keys_in_ms: session.max_time_between_keys_in_ms || 55, init: function() { mixins.PropertiesMixin.init.call(this); |
