fix: contact duplication on converting lead to customer (#29001)

* fix: contact duplication on converting lead to customer

* fix: added test case
This commit is contained in:
Anupam Kumar
2021-12-24 19:13:28 +05:30
committed by GitHub
parent 9c4455f77c
commit cfb6b26e47
2 changed files with 22 additions and 12 deletions

View File

@@ -23,6 +23,17 @@ class TestLead(unittest.TestCase):
customer.customer_group = "_Test Customer Group"
customer.insert()
#check whether lead contact is carried forward to the customer.
contact = frappe.db.get_value('Dynamic Link', {
"parenttype": "Contact",
"link_doctype": "Lead",
"link_name": customer.lead_name,
}, "parent")
if contact:
contact_doc = frappe.get_doc("Contact", contact)
self.assertEqual(contact_doc.has_link(customer.doctype, customer.name), True)
def test_make_customer_from_organization(self):
from erpnext.crm.doctype.lead.lead import make_customer