Update repost_stock.py
diff --git a/erpnext/utilities/repost_stock.py b/erpnext/utilities/repost_stock.py
index 159825a..1e1d5d9 100644
--- a/erpnext/utilities/repost_stock.py
+++ b/erpnext/utilities/repost_stock.py
@@ -77,7 +77,7 @@
 				(select qty as dnpi_qty, qty as so_item_qty,
 					ifnull(delivered_qty, 0) as so_item_delivered_qty, parent, name
 				from `tabSales Order Item` so_item
-				where item_code = %s and reserved_warehouse = %s
+				where item_code = %s and warehouse = %s
 				and exists(select * from `tabSales Order` so
 					where so.name = so_item.parent and so.docstatus = 1
 					and so.status != 'Stopped'))
@@ -208,4 +208,4 @@
 				pass
 		
 		frappe.db.sql("""update `tabSerial No` set warehouse='' where status in ('Delivered', 'Purchase Returned')""")
-		
\ No newline at end of file
+