summaryrefslogtreecommitdiff
path: root/addons/barcodes/static/src/js/barcode_handler_mixin.js
AgeCommit message (Collapse)Author
2016-06-15[FIX] barcodes: manage several barcode widgetsNicolas Martinelli
In some cases, several barcode widgets can be found on the same page. This is for example the case of the stock picking: there is a widget on the `stock.picking` model (main view) itself, and a widget on the `stock.pack.operation` model (modal view). In this case, when the focus is not set directly on the field which needs to be filled in, both widgets will trigger a `barcode_scanned` scanned event. This will call the `on_barcode_scanned` Python method which can lead to errors/warning. For example, the `on_barcode_scanned` method on the `stock.picking` model raises a warning in case the barcode scanned does not match any product/package. The fix is to make sure that the event target is located in the correct DOM element. opw-677506
2015-09-01[ADD] barcodes: BarcodeHandlerMixin that starts/stops the event handlingArthur Maniet
Only the barcode handlers in the front view should listen to barcode events.