fix: removing organization_lead traceback
This commit is contained in:
parent
4723e18f9e
commit
01a0585ba0
@ -71,7 +71,7 @@ erpnext.LeadController = class LeadController extends frappe.ui.form.Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
company_name () {
|
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);
|
this.frm.set_value("lead_name", this.frm.doc.company_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class TestLead(unittest.TestCase):
|
|||||||
customer.insert()
|
customer.insert()
|
||||||
|
|
||||||
def test_create_lead_and_unlinking_dynamic_links(self):
|
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()
|
lead_doc_1 = make_lead()
|
||||||
frappe.get_doc({
|
frappe.get_doc({
|
||||||
"doctype": "Address",
|
"doctype": "Address",
|
||||||
@ -79,7 +79,7 @@ def make_lead(**args):
|
|||||||
"doctype": "Lead",
|
"doctype": "Lead",
|
||||||
"first_name": args.first_name or "Test",
|
"first_name": args.first_name or "Test",
|
||||||
"last_name": args.last_name or "Lead",
|
"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()
|
}).insert()
|
||||||
|
|
||||||
return lead_doc
|
return lead_doc
|
@ -27,7 +27,6 @@
|
|||||||
{
|
{
|
||||||
"doctype": "Lead",
|
"doctype": "Lead",
|
||||||
"email_id": "test_lead4@example.com",
|
"email_id": "test_lead4@example.com",
|
||||||
"organization_lead": 1,
|
|
||||||
"lead_name": "_Test Lead 4",
|
"lead_name": "_Test Lead 4",
|
||||||
"company_name": "_Test Lead 4",
|
"company_name": "_Test Lead 4",
|
||||||
"status": "Open"
|
"status": "Open"
|
||||||
|
@ -9,7 +9,6 @@ QUnit.test("test: lead", function (assert) {
|
|||||||
() => frappe.set_route("List", "Lead"),
|
() => frappe.set_route("List", "Lead"),
|
||||||
() => frappe.new_doc("Lead"),
|
() => frappe.new_doc("Lead"),
|
||||||
() => frappe.timeout(1),
|
() => frappe.timeout(1),
|
||||||
() => cur_frm.set_value("organization_lead", "1"),
|
|
||||||
() => cur_frm.set_value("company_name", lead_name),
|
() => cur_frm.set_value("company_name", lead_name),
|
||||||
() => cur_frm.save(),
|
() => cur_frm.save(),
|
||||||
() => frappe.timeout(1),
|
() => frappe.timeout(1),
|
||||||
|
@ -176,12 +176,12 @@ class Customer(TransactionBase):
|
|||||||
address.append('links', dict(link_doctype='Customer', link_name=self.name))
|
address.append('links', dict(link_doctype='Customer', link_name=self.name))
|
||||||
address.save(ignore_permissions=self.flags.ignore_permissions)
|
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:
|
if not lead.lead_name:
|
||||||
frappe.throw(_("Please mention the Lead Name in Lead {0}").format(self.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={
|
contact_names = frappe.get_all('Dynamic Link', filters={
|
||||||
"parenttype":"Contact",
|
"parenttype":"Contact",
|
||||||
"link_doctype":"Lead",
|
"link_doctype":"Lead",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user