summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2016-09-15 16:17:17 +0200
committerSimon Lejeune <sle@openerp.com>2016-09-15 16:20:18 +0200
commit6647e1f8a98b0fac4310a17c016df0a1a33e13b7 (patch)
treed1b15e79e50d54ed1371f016bc2cec5531917f5f
parent5e6df4280076883c1390b36673dad8ae4b1b2913 (diff)
[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).
-rw-r--r--addons/barcodes/static/src/js/form_view_barcode_handler.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/barcodes/static/src/js/form_view_barcode_handler.js b/addons/barcodes/static/src/js/form_view_barcode_handler.js
index a6fa4b55adf..b00bce51c5e 100644
--- a/addons/barcodes/static/src/js/form_view_barcode_handler.js
+++ b/addons/barcodes/static/src/js/form_view_barcode_handler.js
@@ -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.'));
},