diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 1439b323173..aa26ee228b3 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -192,7 +192,11 @@ class procurement_order(osv.osv): return self.write(cr, uid, ids, {'state': 'confirmed'}, context=context) def run(self, cr, uid, ids, context=None): - for procurement in self.browse(cr, uid, ids, context=context): + for procurement_id in ids: + #we intentionnaly do the browse under the for loop to avoid caching all ids which would be ressource greedy + #and useless as we'll make a refresh later that will invalidate all the cache (and thus the next iteration + #will fetch all the ids again) + procurement = self.browse(cr, uid, procurement_id, context=context) if procurement.state not in ("running", "done"): if self._assign(cr, uid, procurement, context=context): procurement.refresh()