[FIX] barcodes: also allow barcodes triggering buttons in dropdowns

On smaller screens some buttons will be hidden. An example of this is
the 'Validate' button in the stock.picking form view. It is not :visible
but it should still be possible to trigger through scanning a
'O-BTN.validate' barcode.

opw-676741
This commit is contained in:
Joren Van Onder
2016-05-10 12:59:37 +02:00
parent 59982a04a4
commit 28a9336ac8
@@ -15,7 +15,8 @@ var ButtonBarcodeHandlerMixin = _.extend({}, BarcodeHandlerMixin, {
var self = this;
this.on_barcode_scanned = function(barcode) {
var match = barcode.match(/O-BTN\.(.+)/);
if (match && match[1] === self.node.attrs.barcode_trigger && self.$el.is(':visible')) {
if (match && match[1] === self.node.attrs.barcode_trigger &&
(self.$el.is(':visible') || self.$el.parent('.dropdown-menu'))) {
self.on_click();
}
};