[IMP] Stock: various small optimization to load barcode interface faster
Perform search_read instead of read then search Perform some RPC in parrallel instead of sequentially Do not reload uls everytime
This commit is contained in:
committed by
Cedric Snauwaert
parent
2150a6f1e9
commit
5f35530615
@@ -254,12 +254,13 @@ function openerp_picking_widgets(instance){
|
||||
return false;
|
||||
});
|
||||
this.$('.js_qty').focus(function(){
|
||||
oldjsqtyvalue = parseFloat($(this).val());
|
||||
self.getParent().barcode_scanner.disconnect();
|
||||
});
|
||||
this.$('.js_qty').blur(function(){
|
||||
var op_id = $(this).parents("[data-id]:first").data('id');
|
||||
var value = parseFloat($(this).val());
|
||||
if (value>=0){
|
||||
if (value!=oldjsqtyvalue && value>=0){
|
||||
self.getParent().set_operation_quantity(value, op_id);
|
||||
}
|
||||
|
||||
@@ -685,6 +686,14 @@ function openerp_picking_widgets(instance){
|
||||
}
|
||||
|
||||
return loaded_picking.then(function(){
|
||||
var deferred_pack = new instance.web.Model('stock.picking').call('check_group_pack').then(function(result){
|
||||
return self.show_pack = result;
|
||||
});
|
||||
var deferred_lot = new instance.web.Model('stock.picking').call('check_group_lot').then(function(result){
|
||||
return self.show_lot = result;
|
||||
});
|
||||
|
||||
return $.when(deferred_pack, deferred_lot).done(function(){
|
||||
if (!_.isEmpty(self.locations)){
|
||||
return $.when();
|
||||
}
|
||||
@@ -693,23 +702,13 @@ function openerp_picking_widgets(instance){
|
||||
self.locations = locations;
|
||||
});
|
||||
});
|
||||
}).then(function(){
|
||||
return new instance.web.Model('stock.picking').call('check_group_pack').then(function(result){
|
||||
return self.show_pack = result;
|
||||
});
|
||||
}).then(function(){
|
||||
return new instance.web.Model('stock.picking').call('check_group_lot').then(function(result){
|
||||
return self.show_lot = result;
|
||||
});
|
||||
}).then(function(){
|
||||
if (self.picking.pack_operation_exist === false){
|
||||
self.picking.recompute_pack_op = false;
|
||||
return new instance.web.Model('stock.picking').call('do_prepare_partial',[[self.picking.id]]);
|
||||
}
|
||||
}).then(function(){
|
||||
return new instance.web.Model('stock.pack.operation').call('search',[[['picking_id','=',self.picking.id]]])
|
||||
}).then(function(pack_op_ids){
|
||||
return new instance.web.Model('stock.pack.operation').call('read',[pack_op_ids, [], new instance.web.CompoundContext()])
|
||||
return new instance.web.Model('stock.pack.operation').call('search_read',[[['picking_id','=',self.picking.id]]])
|
||||
}).then(function(operations){
|
||||
self.packoplines = operations;
|
||||
var package_ids = [];
|
||||
@@ -725,11 +724,13 @@ function openerp_picking_widgets(instance){
|
||||
}).then(function(packages){
|
||||
self.packages = packages;
|
||||
}).then(function(){
|
||||
return new instance.web.Model('product.ul').call('search',[[]])
|
||||
}).then(function(uls_ids){
|
||||
return new instance.web.Model('product.ul').call('read',[uls_ids, []])
|
||||
}).then(function(uls){
|
||||
self.uls = uls;
|
||||
if (!_.isEmpty(self.uls)){
|
||||
return $.when();
|
||||
}
|
||||
return new instance.web.Model('product.ul').call('search_read',[[]]).then(function(uls){
|
||||
self.uls = uls;
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
start: function(){
|
||||
|
||||
Reference in New Issue
Block a user