diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index e5a2102e44..0825557f18 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -1173,7 +1173,7 @@ class StockEntry(StockController): frappe.db.sql("""UPDATE `tabPurchase Order Item Supplied` pos SET pos.supplied_qty = (SELECT ifnull(sum(transfer_qty), 0) FROM `tabStock Entry Detail` sed WHERE pos.name = sed.po_detail and sed.docstatus = 1) - WHERE pos.docstatus = 1""") + WHERE pos.docstatus = 1 and pos.parent = %s""", self.purchase_order) #Update reserved sub contracted quantity in bin based on Supplied Item Details and for d in self.get("items"):