summaryrefslogtreecommitdiff
path: root/addons/barcodes/views
diff options
context:
space:
mode:
authorArthur Maniet <arthurmaniet@me.com>2015-07-08 08:08:25 +0200
committerArthur Maniet <arthurmaniet@me.com>2015-09-01 13:25:52 +0200
commit2df4060c776c7a6a946f2b7a164ff7bbbe5e854a (patch)
tree21d8c78356237dce5ed7575964fc3142cd29abb5 /addons/barcodes/views
parentc1cc4b830bc2fd2b4cd01ff37b250d98e9dacb13 (diff)
[ADD] barcodes: onchange-like mechanism to react to scans in form view
For a model to use it, it must : - Inherit barcodes.barcode_events_mixin and override on_barcode_scanned(self, barcode) - Add <field name=barcode_scanned widget=barcode_handler/> to each form view that should listen to barcode events and trigger on_barcode_scanned. The method on_barcode_scanned works just like an onchange.
Diffstat (limited to 'addons/barcodes/views')
-rw-r--r--addons/barcodes/views/templates.xml1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/barcodes/views/templates.xml b/addons/barcodes/views/templates.xml
index f0f92579f49..2db01ead8de 100644
--- a/addons/barcodes/views/templates.xml
+++ b/addons/barcodes/views/templates.xml
@@ -6,6 +6,7 @@
<xpath expr="." position="inside">
<script type="text/javascript" src="/barcodes/static/src/js/barcode_parser.js"></script>
<script type="text/javascript" src="/barcodes/static/src/js/barcode_events.js"></script>
+ <script type="text/javascript" src="/barcodes/static/src/js/form_view_barcode_handler.js"></script>
</xpath>
</template>