From da667b573ddb9a4151deba07babba70e323d1973 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 4 Sep 2015 12:44:56 +0200 Subject: [PATCH] [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 --- addons/stock/static/src/js/widgets.js | 3 +++ 1 file changed, 3 insertions(+) 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;