fix: removing organization_lead traceback
diff --git a/erpnext/crm/doctype/lead/lead.js b/erpnext/crm/doctype/lead/lead.js
index 97e6315..75af937 100644
--- a/erpnext/crm/doctype/lead/lead.js
+++ b/erpnext/crm/doctype/lead/lead.js
@@ -71,7 +71,7 @@
}
company_name () {
- if (this.frm.doc.organization_lead && !this.frm.doc.lead_name) {
+ if (!this.frm.doc.lead_name) {
this.frm.set_value("lead_name", this.frm.doc.company_name);
}
}
diff --git a/erpnext/crm/doctype/lead/test_lead.py b/erpnext/crm/doctype/lead/test_lead.py
index 18e0692..cadc1a2 100644
--- a/erpnext/crm/doctype/lead/test_lead.py
+++ b/erpnext/crm/doctype/lead/test_lead.py
@@ -35,7 +35,7 @@
customer.insert()
def test_create_lead_and_unlinking_dynamic_links(self):
- lead_doc = make_lead(first_name = "Lorem", last_name="Ipsum")
+ lead_doc = make_lead(first_name = "Lorem", last_name="Ipsum", email_id="lorem_ipsum@example.com")
lead_doc_1 = make_lead()
frappe.get_doc({
"doctype": "Address",
@@ -79,7 +79,7 @@
"doctype": "Lead",
"first_name": args.first_name or "Test",
"last_name": args.last_name or "Lead",
- "email_id": args.email_id or "new_lead{}@example.com".format(random_string(5)),
+ "email_id": args.email_id or "new_lead_{}@example.com".format(random_string(5)),
}).insert()
return lead_doc
\ No newline at end of file
diff --git a/erpnext/crm/doctype/lead/test_records.json b/erpnext/crm/doctype/lead/test_records.json
index 39864e2..3158add 100644
--- a/erpnext/crm/doctype/lead/test_records.json
+++ b/erpnext/crm/doctype/lead/test_records.json
@@ -27,7 +27,6 @@
{
"doctype": "Lead",
"email_id": "test_lead4@example.com",
- "organization_lead": 1,
"lead_name": "_Test Lead 4",
"company_name": "_Test Lead 4",
"status": "Open"
diff --git a/erpnext/crm/doctype/lead/tests/test_lead_organization.js b/erpnext/crm/doctype/lead/tests/test_lead_organization.js
index 4395935..7fb9573 100644
--- a/erpnext/crm/doctype/lead/tests/test_lead_organization.js
+++ b/erpnext/crm/doctype/lead/tests/test_lead_organization.js
@@ -9,7 +9,6 @@
() => frappe.set_route("List", "Lead"),
() => frappe.new_doc("Lead"),
() => frappe.timeout(1),
- () => cur_frm.set_value("organization_lead", "1"),
() => cur_frm.set_value("company_name", lead_name),
() => cur_frm.save(),
() => frappe.timeout(1),
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 3b62081..66edcd0 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -176,12 +176,12 @@
address.append('links', dict(link_doctype='Customer', link_name=self.name))
address.save(ignore_permissions=self.flags.ignore_permissions)
- lead = frappe.db.get_value("Lead", self.lead_name, ["organization_lead", "lead_name", "email_id", "phone", "mobile_no", "gender", "salutation"], as_dict=True)
+ lead = frappe.db.get_value("Lead", self.lead_name, ["company_name", "lead_name", "email_id", "phone", "mobile_no", "gender", "salutation"], as_dict=True)
if not lead.lead_name:
frappe.throw(_("Please mention the Lead Name in Lead {0}").format(self.lead_name))
- if lead.organization_lead:
+ if lead.company_name:
contact_names = frappe.get_all('Dynamic Link', filters={
"parenttype":"Contact",
"link_doctype":"Lead",