From 93e0ec6663e983ab0a6238a0cbc28a39b73336ee Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 11 May 2015 11:32:25 +0530 Subject: [PATCH] Show only sub-contracted purchase order in stock entry for subcontracting --- erpnext/stock/doctype/stock_entry/stock_entry.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 6bb2e2f4ff2..e954cf628b4 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -43,6 +43,15 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ return erpnext.queries.item({is_stock_item: "Yes"}); } }; + + this.frm.set_query("purchase_order", function() { + return { + "filters": { + "docstatus": 1, + "is_subcontracted": "Yes" + } + }; + }); if(cint(frappe.defaults.get_default("auto_accounting_for_stock"))) { this.frm.add_fetch("company", "stock_adjustment_account", "expense_account");