From 9af68078f65a52182bc1b8fc3c5c2f6a6bc985a9 Mon Sep 17 00:00:00 2001 From: bcornwellmott Date: Thu, 16 Jun 2016 14:10:57 -0700 Subject: [PATCH] Add "Get items from Material Request" Allows users to pull items from multiple Material Requests into a Request for Quotation --- .../request_for_quotation.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js index 5fb8b80335b..aab006f8625 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js @@ -103,6 +103,22 @@ frappe.ui.form.on("Request for Quotation Supplier",{ erpnext.buying.RequestforQuotationController = erpnext.buying.BuyingController.extend({ refresh: function() { this._super(); + if (this.frm.doc.docstatus===0) { + cur_frm.add_custom_button(__('Material Request'), + function() { + frappe.model.map_current_doc({ + method: "erpnext.stock.doctype.material_request.material_request.make_request_for_quotation", + source_doctype: "Material Request", + get_query_filters: { + material_request_type: "Purchase", + docstatus: 1, + status: ["!=", "Stopped"], + per_ordered: ["<", 99.99], + company: cur_frm.doc.company + } + }) + }, __("Get items from")); + } }, calculate_taxes_and_totals: function() {