[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).
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user