[FIX]barcode scanner, correct use of disabled on process and put in pack buttons

bzr revid: csn@openerp.com-20140324083401-lmc7s43ix3nqg19j
This commit is contained in:
Cedric Snauwaert 2014-03-24 09:34:01 +01:00
parent 03da57c1ec
commit 44efd3e80f
1 changed files with 7 additions and 3 deletions

View File

@ -272,10 +272,9 @@ function openerp_picking_widgets(instance){
},
check_content_screen: function(){
//get all visible element and if none has positive qty, disable put in pack and process button
//TODO process should be clickable if we have a container visible at screen and not processed
var self = this;
var qties = this.$('.js_pack_op_line:not(.processed):not(.hidden) .js_qty').map(function(){return $(this).attr('placeholder')});
var container = this.$('.js_pack_op_line.container_head:not(.processed):not(.hidden)')
var disabled = true;
$.each(qties,function(index, value){
if (parseInt(value)>0){
@ -283,7 +282,12 @@ function openerp_picking_widgets(instance){
}
});
if (disabled){
self.$('.js_drop_down').addClass('disabled');
if (container.length===0){
self.$('.js_drop_down').addClass('disabled');
}
else {
self.$('.js_drop_down').removeClass('disabled');
}
self.$('.js_pick_pack').addClass('disabled');
}
else{