From 01fe4a37261e3f71f49b3546ed2f49163088265f Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Sun, 1 Jul 2018 16:41:39 +0530 Subject: [PATCH] [Fix] Consider the cancelled purchase receipt in backflush raw materials (#14753) --- erpnext/controllers/buying_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 82ea394a2d..f74c3a588d 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -710,7 +710,7 @@ def get_backflushed_subcontracted_raw_materials_from_se(purchase_orders, purchas from `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pri, `tabPurchase Receipt Item Supplied` prsi where pr.name = pri.parent and pr.name = prsi.parent and pri.purchase_order in (%s) - and pri.item_code = prsi.main_item_code and pr.name != '%s' + and pri.item_code = prsi.main_item_code and pr.name != '%s' and pr.docstatus = 1 group by prsi.rm_item_code """ % (','.join(['%s'] * len(purchase_orders)), purchase_receipt), tuple(purchase_orders)))