From de417d2774fdca03dee38dcb67ef14a8a5cb58f9 Mon Sep 17 00:00:00 2001 From: Anupam K Date: Wed, 22 Jul 2020 00:58:13 +0530 Subject: [PATCH 1/2] feat: Provision to make RFQ against Opportunity --- erpnext/crm/doctype/opportunity/opportunity.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index f1b81713496..28aedde1225 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -76,6 +76,11 @@ frappe.ui.form.on("Opportunity", { function() { frm.trigger("make_supplier_quotation") }, __('Create')); + + frm.add_custom_button(__('Request For Quotation'), + function() { + frm.trigger("make_request_for_quotation") + }, __('Create')); } frm.add_custom_button(__('Quotation'), @@ -126,6 +131,13 @@ frappe.ui.form.on("Opportunity", { }) }, + make_request_for_quotation: function(frm) { + frappe.model.open_mapped_doc({ + method: "erpnext.crm.doctype.opportunity.opportunity.make_request_for_quotation", + frm: cur_frm + }) + }, + toggle_mandatory: function(frm) { frm.toggle_reqd("items", frm.doc.with_items ? 1:0); } From 5bd0b93acf632845135762950c809cc496140a54 Mon Sep 17 00:00:00 2001 From: Anupam K Date: Wed, 22 Jul 2020 18:10:57 +0530 Subject: [PATCH 2/2] fix: cur_frm -> frm --- erpnext/crm/doctype/opportunity/opportunity.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index 28aedde1225..7bae8035080 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -127,14 +127,14 @@ frappe.ui.form.on("Opportunity", { make_supplier_quotation: function(frm) { frappe.model.open_mapped_doc({ method: "erpnext.crm.doctype.opportunity.opportunity.make_supplier_quotation", - frm: cur_frm + frm: frm }) }, make_request_for_quotation: function(frm) { frappe.model.open_mapped_doc({ method: "erpnext.crm.doctype.opportunity.opportunity.make_request_for_quotation", - frm: cur_frm + frm: frm }) },