diff options
| author | Arthur Maniet <arthurmaniet@me.com> | 2015-07-08 08:08:25 +0200 |
|---|---|---|
| committer | Arthur Maniet <arthurmaniet@me.com> | 2015-09-01 13:25:52 +0200 |
| commit | 2df4060c776c7a6a946f2b7a164ff7bbbe5e854a (patch) | |
| tree | 21d8c78356237dce5ed7575964fc3142cd29abb5 /addons/barcodes/views | |
| parent | c1cc4b830bc2fd2b4cd01ff37b250d98e9dacb13 (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.xml | 1 |
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> |
