[FIX] stock: barcode, display pickings of active stock picking type
If a stock picking type was disabled, but had pickings in assigned or partially available state, the barcode interface main menu crashed Because the stock picking type was not available in pickings_by_type array
This commit is contained in:
parent
647afdf655
commit
e018081b33
|
@ -471,12 +471,14 @@ function openerp_picking_widgets(instance){
|
|||
return new instance.web.Model('stock.picking.type').get_func('search_read')([],[])
|
||||
.then(function(types){
|
||||
self.picking_types = types;
|
||||
type_ids = [];
|
||||
for(var i = 0; i < types.length; i++){
|
||||
self.pickings_by_type[types[i].id] = [];
|
||||
type_ids.push(types[i].id);
|
||||
}
|
||||
self.pickings_by_type[0] = [];
|
||||
|
||||
return new instance.web.Model('stock.picking').call('search_read',[ [['state','in', ['assigned', 'partially_available']]], [] ], {context: new instance.web.CompoundContext()});
|
||||
return new instance.web.Model('stock.picking').call('search_read',[ [['state','in', ['assigned', 'partially_available']], ['picking_type_id', 'in', type_ids]], [] ], {context: new instance.web.CompoundContext()});
|
||||
|
||||
}).then(function(pickings){
|
||||
self.pickings = pickings;
|
||||
|
|
Loading…
Reference in New Issue