summaryrefslogtreecommitdiff
path: root/addons/barcodes/static/src
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2017-08-02 17:24:46 +0200
committerAaron Bohy <aab@odoo.com>2017-08-25 15:54:56 +0200
commit5b968ad37108015805cfebd6b1ab0ea97e595361 (patch)
treefb010fbf28d54e8134bdcf6e3ef965ada5a157b8 /addons/barcodes/static/src
parentb131e9b0ef458e8cc00b0a2eb6c1b4d8dfe889a0 (diff)
[FIX] web, barcodes: restore `disableAutofocus` option
This option has been removed with the new views but was used in barcode. The form renderer was also dealing with some part of the autofocus but this should only be handled by the controller. The logic is now only in the controller and a test case has been added.
Diffstat (limited to 'addons/barcodes/static/src')
-rw-r--r--addons/barcodes/static/src/js/barcode_form_view.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/barcodes/static/src/js/barcode_form_view.js b/addons/barcodes/static/src/js/barcode_form_view.js
index 37fa34dcf95..7b82e68405c 100644
--- a/addons/barcodes/static/src/js/barcode_form_view.js
+++ b/addons/barcodes/static/src/js/barcode_form_view.js
@@ -171,6 +171,10 @@ FormController.include({
candidate: this.activeBarcode[name] && this.activeBarcode[name].handle === this.handle ?
this.activeBarcode[name].candidate : null,
};
+
+ // we want to disable autofocus when activating the barcode to avoid
+ // putting the scanned value in the focused field
+ this.disableAutofocus = true;
},
/**
* @private