From ed71c36748953a53ec27c7102a50230e0526ba6c Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 28 Jun 2018 18:36:35 +0530 Subject: [PATCH] [Fix] Not able to save subcontracted purchase receipt --- erpnext/controllers/buying_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 49f752c66b..82ea394a2d 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -699,7 +699,7 @@ def get_subcontracted_raw_materials_from_se(purchase_orders): from `tabStock Entry` se,`tabStock Entry Detail` sed where se.name = sed.parent and se.docstatus=1 and se.purpose='Subcontract' - and se.purchase_order= (%s) and ifnull(sed.t_warehouse, '') != '' + and se.purchase_order in (%s) and ifnull(sed.t_warehouse, '') != '' group by sed.item_code, sed.t_warehouse """ % (','.join(['%s'] * len(purchase_orders))), tuple(purchase_orders), as_dict=1) @@ -709,7 +709,7 @@ def get_backflushed_subcontracted_raw_materials_from_se(purchase_orders, purchas prsi.rm_item_code as item_code, sum(prsi.consumed_qty) as qty 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= (%s) + 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' group by prsi.rm_item_code """ % (','.join(['%s'] * len(purchase_orders)), purchase_receipt), tuple(purchase_orders)))