summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorArthur Maniet <arthurmaniet@me.com>2015-07-08 08:17:16 +0200
committerArthur Maniet <arthurmaniet@me.com>2015-09-01 13:26:02 +0200
commit9cf6339b3e2fc489da067dbb878ccf2d2ed5446d (patch)
treefc5e1c39b29a3860f1bc3d7320cca4bcbf7b67fa /addons/web/static/src
parent670d759dbf1c7153c3df17f533972b47d13e84f3 (diff)
[ADD] web: fields char and many2one can take an option barcode_events
This allows to detect barcode scans while the focus is in such a field. It is not the default behaviour because buffering keystrokes to see if they are a barcode then releasing them if they aren't isn't trivial (it is impossible to trigger a native keyboard event).
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/xml/base.xml2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index c79d9fc1f86..428a12db511 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -666,6 +666,7 @@
<span t-att-class="'oe_form_field '+widget.widget_class" t-att-style="widget.node.attrs.style">
<t t-if="!widget.get('effective_readonly')">
<input t-att-type="widget.password ? 'password' : 'text'"
+ t-att-barcode_events="widget.options.barcode_events"
t-att-id="widget.id_for_label"
t-att-tabindex="widget.node.attrs.tabindex"
t-att-autofocus="widget.node.attrs.autofocus"
@@ -820,6 +821,7 @@
class="oe_m2o_cm_button fa fa-external-link" draggable="false"/>
<div>
<input type="text"
+ t-att-barcode_events="widget.options.barcode_events"
t-att-id="widget.id_for_label"
t-att-tabindex="widget.node.attrs.tabindex"
t-att-autofocus="widget.node.attrs.autofocus"