From 80afec9110d065faa89d78859d4f258b79daefbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 13 May 2008 16:49:13 +0200 Subject: [PATCH] Don't change context in function --- packing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packing.py b/packing.py index e077718207..d992070205 100644 --- a/packing.py +++ b/packing.py @@ -476,6 +476,10 @@ class PackingOut(OSV): move_obj = self.pool.get('stock.move') product_obj = self.pool.get('product.product') uom_obj = self.pool.get('product.uom') + + if context is None: + context = {} + packing = self.browse(cursor, user, id, context=context) parent_to_locations = {} inventory_moves = [] @@ -497,7 +501,7 @@ class PackingOut(OSV): parent_to_locations[move.from_location.id] = childs # Collect all raw quantities - context = context or {} + context = context.copy() context.update({'in_states': ['done', 'assigned'], 'out_states': ['done', 'assigned']}) raw_data = product_obj.raw_products_by_location(