diff --git a/inventory.py b/inventory.py index d2ea22c065..38d44947c3 100644 --- a/inventory.py +++ b/inventory.py @@ -125,10 +125,11 @@ class Inventory(OSV): for inventory in inventories: # Compute product quantities if inventory.date: - context['stock_date_end'] = inventory.date + ctx = context and context.copy() or {} + ctx['stock_date_end'] = inventory.date pbl = product_obj.products_by_location( cursor, user, [inventory.location.id], - context=context) + context=ctx) else: pbl = product_obj.products_by_location( cursor, user, [inventory.location.id], context=context)