From 273f017ca7f8854d2af06e7b0bed45d726ecb204 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Wed, 7 May 2008 01:44:09 +0200 Subject: [PATCH] Fix: populate correctly uom_index --- packing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packing.py b/packing.py index 42110172a5..c9d0c3f83d 100644 --- a/packing.py +++ b/packing.py @@ -287,10 +287,14 @@ class PackingOut(OSV): location_obj = self.pool.get('stock.location') move_obj = self.pool.get('stock.move') product_obj = self.pool.get('product.product') + uom_obj = self.pool.get('product.uom') packing = self.browse(cursor, user, id, context=context) parent_to_locations = {} inventory_moves = [] - uom_index = {} + uom_ids = uom_obj.search(cursor, user, [], context=context) + uom_index = dict( (uom.id, uom) for uom in \ + uom_obj.browse(cursor, user, uom_ids, context=context)) + location_index = {} # Fetch child_of for each location for move in packing.inventory_moves: