diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index 80588ee0029..6ebb0dab570 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -95,13 +95,6 @@ frappe.ui.form.on("Opportunity", { }, __('Create')); } - if (frm.doc.opportunity_from != "Customer") { - frm.add_custom_button(__('Customer'), - function() { - frm.trigger("make_customer") - }, __('Create')); - } - frm.add_custom_button(__('Quotation'), function() { frm.trigger("create_quotation") @@ -203,13 +196,6 @@ erpnext.crm.Opportunity = class Opportunity extends frappe.ui.form.Controller { frm: cur_frm }) } - - make_customer() { - frappe.model.open_mapped_doc({ - method: "erpnext.crm.doctype.opportunity.opportunity.make_customer", - frm: cur_frm - }) - } }; extend_cscript(cur_frm.cscript, new erpnext.crm.Opportunity({frm: cur_frm})); diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 9e620312b9f..23ad98a2828 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -265,26 +265,6 @@ def make_quotation(source_name, target_doc=None): return doclist -@frappe.whitelist() -def make_customer(source_name, target_doc=None): - def set_missing_values(source, target): - if source.opportunity_from == "Lead": - target.lead_name = source.party_name - if source.opportunity_from == "Prospect": - target.prospect = source.party_name - - doclist = get_mapped_doc("Opportunity", source_name, { - "Opportunity": { - "doctype": "Customer", - "field_map": { - "currency": "default_currency", - "customer_name": "customer_name" - } - } - }, target_doc, set_missing_values) - - return doclist - @frappe.whitelist() def make_request_for_quotation(source_name, target_doc=None): def update_item(obj, target, source_parent):