Add stock_date_end in context if no one is given for forecast_quantity

This commit is contained in:
Cédric Krier committed 2008-08-29 22:38:05 +02:00
1 parent c6cb3e6df9
commit 955cb51440
1 file changed
+7
+7
View File
@@ -21,6 +21,9 @@ class Product(OSV):
if context['stock_date_end'] != datetime.date.today():
context = context.copy()
context['stock_date_end'] = datetime.date.today()
if name == 'forecast_quantity' and not context.get('stock_date_end'):
context = context.copy()
context['stock_date_end'] = datetime.date.max
pbl = self.products_by_location(cursor, user,
location_ids=context['locations'], product_ids=ids,
with_childs=True, context=context)
@@ -51,6 +54,10 @@ class Product(OSV):
context = context.copy()
del context['stock_date_end']
if name == 'forecast_quantity' and not context.get('stock_date_end'):
context = context.copy()
context['stock_date_end'] = datetime.date.max
pbl = self.products_by_location(
cursor, user, location_ids=context['locations'], with_childs=True,
skip_zero=False, context=context).iteritems()