summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-09-04 12:44:56 +0200
committerCedric Snauwaert <csn@openerp.com>2015-11-26 14:08:44 +0100
commitda667b573ddb9a4151deba07babba70e323d1973 (patch)
treeea2dac5221551a18576a1d8919615de181ebf28c /addons
parentadf6d0e557dd952c6366b9010638e4fe52563803 (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/stock/static/src/js/widgets.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/stock/static/src/js/widgets.js b/addons/stock/static/src/js/widgets.js
index 3b877dfb9f4..161a16be339 100644
--- a/addons/stock/static/src/js/widgets.js
+++ b/addons/stock/static/src/js/widgets.js
@@ -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;