From 06927a20b29fb9f88c590e1cff7294e84e019a80 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 25 Aug 2014 14:08:54 +0530 Subject: [PATCH] Update repost_stock.py --- erpnext/utilities/repost_stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/utilities/repost_stock.py b/erpnext/utilities/repost_stock.py index 159825a495..1e1d5d95e5 100644 --- a/erpnext/utilities/repost_stock.py +++ b/erpnext/utilities/repost_stock.py @@ -77,7 +77,7 @@ def get_reserved_qty(item_code, warehouse): (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 @@ def reset_serial_no_status_and_warehouse(serial_nos=None): pass frappe.db.sql("""update `tabSerial No` set warehouse='' where status in ('Delivered', 'Purchase Returned')""") - \ No newline at end of file +