[IMP] stock: Fixed keyerror by checking type of ids for int and long(case:18253)
authorpso (OpenERP) <pso@tinyerp.com>
Tue, 18 Oct 2011 13:08:20 +0000 (18:38 +0530)
committerpso (OpenERP) <pso@tinyerp.com>
Tue, 18 Oct 2011 13:08:20 +0000 (18:38 +0530)
bzr revid: pso@tinyerp.com-20111018130820-nt5kkuvj0jm82jbi

addons/stock/stock.py

index 0a04c4b..e61c3d9 100644 (file)
@@ -1631,6 +1631,8 @@ class stock_move(osv.osv):
     }
 
     def write(self, cr, uid, ids, vals, context=None):
+        if isinstance(ids, (int, long)):
+            ids = [ids]
         if uid != 1:
             frozen_fields = set(['product_qty', 'product_uom', 'product_uos_qty', 'product_uos', 'location_id', 'location_dest_id', 'product_id'])
             for move in self.browse(cr, uid, ids, context=context):