revert: creation of customer from opportunity

This commit is contained in:
Anupam 2021-08-25 17:36:53 +05:30
parent c644fbb102
commit 5ad8afcc8d
2 changed files with 0 additions and 34 deletions

View File

@ -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}));

View File

@ -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):