Skip to content

Commit

Permalink
fix: creation of contact, customer, opportunity, quotation and prospe…
Browse files Browse the repository at this point in the history
…ct from lead --prettier

(cherry picked from commit 5844897)

# Conflicts:
#	erpnext/crm/doctype/lead/lead.js
  • Loading branch information
Nihantra-Patel authored and mergify[bot] committed Sep 19, 2024
1 parent ef10c4e commit 5a2a404
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions erpnext/crm/doctype/lead/lead.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ erpnext.LeadController = class LeadController extends frappe.ui.form.Controller
erpnext.toggle_naming_series();

if (!this.frm.is_new() && doc.__onload && !doc.__onload.is_customer) {
<<<<<<< HEAD
<<<<<<< HEAD
this.frm.add_custom_button(__("Customer"), this.make_customer, __("Create"));
this.frm.add_custom_button(
Expand Down Expand Up @@ -55,12 +56,13 @@ erpnext.LeadController = class LeadController extends frappe.ui.form.Controller
__("Create")
);
>>>>>>> 8304d19e8b (fix: creation of contact, customer, opportunity, quotation and prospect from lead)
=======
this.frm.add_custom_button(__("Customer"), this.make_customer.bind(this), __("Create"));
this.frm.add_custom_button(__("Opportunity"), this.make_opportunity.bind(this), __("Create"));
this.frm.add_custom_button(__("Quotation"), this.make_quotation.bind(this), __("Create"));
>>>>>>> 5844897c34 (fix: creation of contact, customer, opportunity, quotation and prospect from lead --prettier)
if (!doc.__onload.linked_prospects.length) {
this.frm.add_custom_button(
__("Prospect"),
this.make_prospect.bind(this),
__("Create")
);
this.frm.add_custom_button(__("Prospect"), this.make_prospect.bind(this), __("Create"));
this.frm.add_custom_button(__("Add to Prospect"), this.add_lead_to_prospect, __("Action"));
}
}
Expand Down Expand Up @@ -184,15 +186,15 @@ erpnext.LeadController = class LeadController extends frappe.ui.form.Controller
const d = new frappe.ui.Dialog({
title: __("Create Opportunity"),
fields: fields,
primary_action: function(data) {
primary_action: function (data) {
frappe.call({
method: "create_prospect_and_contact",
doc: frm.doc,
args: {
data: data,
},
freeze: true,
callback: function(r) {
callback: function (r) {
if (!r.exc) {
frappe.model.open_mapped_doc({
method: "erpnext.crm.doctype.lead.lead.make_opportunity",
Expand Down

0 comments on commit 5a2a404

Please sign in to comment.