[IMP] stock: Fixed keyerror by checking type of ids for int and long(case:18253)
[odoo/odoo.git] / 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):