From dda6b3fe3028c2ad133dc3aedf7dff355e5c1f43 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Tue, 29 Sep 2009 12:14:07 +0200 Subject: [PATCH] Use local context instead of editing global one (transplanted from efd54bea6af8b7f6cce82bcdeced7a64c2fb36eb) --- inventory.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)