From 9faed1b43382bcd7e92bc7a224e6dec87deba199 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 14 Mar 2019 23:32:25 +0530 Subject: [PATCH] feat: added button get items from material request in stock entry --- .../stock/doctype/stock_entry/stock_entry.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 225c1e90ad..0193849235 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -184,6 +184,23 @@ frappe.ui.form.on('Stock Entry', { } }) }, __("Get items from")); + + frm.add_custom_button(__('Material Request'), function() { + erpnext.utils.map_current_doc({ + method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry", + source_doctype: "Material Request", + target: frm, + date_field: "schedule_date", + setters: { + company: frm.doc.company, + }, + get_query_filters: { + docstatus: 1, + material_request_type: "Material Transfer", + status: ['!=', 'Transferred'] + } + }) + }, __("Get items from")); } if (frm.doc.docstatus===0 && frm.doc.purpose == "Material Issue") { frm.add_custom_button(__('Expired Batches'), function() {