Merge pull request #21600 from anupamvs/lead-customer-issue

fix: adding Email and Phone in Contact child table
This commit is contained in:
rohitwaghchaure 2020-05-15 04:43:38 +05:30 committed by GitHub
commit 10e24d9249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,6 +165,10 @@ class Customer(TransactionBase):
contact.mobile_no = lead.mobile_no
contact.is_primary_contact = 1
contact.append('links', dict(link_doctype='Customer', link_name=self.name))
if lead.email_id:
contact.append('email_ids', dict(email_id=lead.email_id, is_primary=1))
if lead.mobile_no:
contact.append('phone_nos', dict(phone=lead.mobile_no, is_primary_mobile_no=1))
contact.flags.ignore_permissions = self.flags.ignore_permissions
contact.autoname()
if not frappe.db.exists("Contact", contact.name):