From a77fa45f88220e986edb664042e2c3759f0b404c Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Thu, 18 Sep 2008 16:23:17 +0200 Subject: [PATCH] Handle empty context --- product.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/product.py b/product.py index c0f0e8e885..c9b299c2a9 100644 --- a/product.py +++ b/product.py @@ -94,10 +94,11 @@ class Product(OSV): location_obj = self.pool.get('stock.location') if not location_ids: return [] - - # Skip warehouse location in favor of their storage location - # to compute quantities. Keep track of which ids to remove - # and to add after the query. + if not context: + context= {} + # Skip warehouse location in favor of their storage location + # to compute quantities. Keep track of which ids to remove + # and to add after the query. location_ids = set(location_ids) storage_to_remove = set() wh_to_add= {}