diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index 26975c552e2..e70745e8f51 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -19,14 +19,6 @@ frappe.ui.form.on("Opportunity", { } }); }, - // customer: function(frm) { - // frm.trigger('set_contact_link'); - // erpnext.utils.get_party_details(frm); - // }, - - // lead: function(frm) { - // frm.trigger('set_contact_link'); - // }, with_items: function(frm) { frm.trigger('toggle_mandatory'); @@ -46,7 +38,6 @@ frappe.ui.form.on("Opportunity", { refresh: function(frm) { var doc = frm.doc; // frm.events.enquiry_from(frm); - // frm.trigger('set_contact_link'); frm.trigger('toggle_mandatory'); frm.trigger("set_dynamic_field_label"); erpnext.toggle_naming_series(); @@ -83,13 +74,6 @@ frappe.ui.form.on("Opportunity", { } }, - // set_contact_link: function(frm) { - // if(frm.doc.customer) { - // frappe.dynamic_link = {doc: frm.doc, fieldname: 'customer', doctype: 'Customer'} - // } else if(frm.doc.lead) { - // frappe.dynamic_link = {doc: frm.doc, fieldname: 'lead', doctype: 'Lead'} - // } - // }, set_dynamic_field_label: function(frm){ if (frm.doc.opportunity_from == "Customer") { @@ -117,10 +101,6 @@ frappe.ui.form.on("Opportunity", { // TODO commonify this code erpnext.crm.Opportunity = frappe.ui.form.Controller.extend({ onload: function() { - // if(!this.frm.doc.enquiry_from && this.frm.doc.customer) - // this.frm.doc.enquiry_from = "Customer"; - // if(!this.frm.doc.enquiry_from && this.frm.doc.lead) - // this.frm.doc.enquiry_from = "Lead"; if(!this.frm.doc.status) set_multiple(this.frm.doc.doctype, this.frm.doc.name, { status:'Open' }); @@ -168,7 +148,7 @@ erpnext.crm.Opportunity = frappe.ui.form.Controller.extend({ $.extend(cur_frm.cscript, new erpnext.crm.Opportunity({frm: cur_frm})); cur_frm.cscript.onload_post_render = function(doc, cdt, cdn) { - if(doc.opportunity_from == 'Lead' && doc.lead) + if(doc.opportunity_from == 'Lead' && doc.customer_lead) cur_frm.cscript.lead(doc, cdt, cdn); }