[FIX] stock: barcode interface, do not reload locations all the time

Locations were search & read each time you changed
the quantity of a product in a picking.

Once the locations loaded the firs time, this is unlikely
the locations will change during the operation. It shoudln't,
at least.

Therefore, for performances, we avoid to load the locations
each time the picking is reloaded.

opw-648529
Fixes #8344
This commit is contained in:
Denis Ledoux 2015-09-04 12:44:56 +02:00 committed by Cedric Snauwaert
parent adf6d0e557
commit da667b573d
1 changed files with 3 additions and 0 deletions

View File

@ -690,6 +690,9 @@ function openerp_picking_widgets(instance){
}
return loaded_picking.then(function(){
if (!_.isEmpty(self.locations)){
return $.when();
}
return new instance.web.Model('stock.location').call('search',[[['usage','=','internal']]]).then(function(locations_ids){
return new instance.web.Model('stock.location').call('read',[locations_ids, []]).then(function(locations){
self.locations = locations;