[FIX] barcodes: correctly unbind quantity event listener

The quantity event handler is not correctly unbound when its action
is deleted, resulting in multiple window.prompt asking the quantity
of the products if you go mulitple times trough a view when a widget
implementing the barcode thing is used.

There seems to be a bug in the framework ("barcode_scanned" events
are registered the same way than the "keypress" one on core.bus
but they don't have suffer from the same issue).
This commit is contained in:
Simon Lejeune
2016-09-15 16:20:18 +02:00
parent 5e6df42800
commit 6647e1f8a9
@@ -52,6 +52,11 @@ var FormViewBarcodeHandler = common.AbstractField.extend(BarcodeHandlerMixin, {
}
},
destroy: function () {
this.stop_listening();
this._super.apply(this, arguments);
},
_display_no_edit_mode_warning: function() {
this.do_warn(_t('Error : Document not editable'), _t('To modify this document, please first start edition.'));
},