From 4e6805b04ef48f47954f703e10dc95f525184541 Mon Sep 17 00:00:00 2001 From: Ashish Shah Date: Fri, 2 Jul 2021 13:35:04 +0530 Subject: [PATCH] fix: When Lead is created with mobile_no, mobile_no value gets lost (it is overwritten by phon value) (#26116) Steps to reproduce [1]Create a Lead. [2]Enter Person Name(lead_name): XX under Contact section, enter Phone(phone): 11 and Mobile No.(mobile_no):22 [3]Save it [4] F12, cur_frm.doc.phone : 11 (correct) cur_frm.doc.mobile_no : 11 (incorrect) [5]Under Address & Contact section ,check contact_html it shows ty Phone: 22 (correct) Phone: 11 (in correct) Actual: mobile_no value is lost. it is overwritten by phone value Expected: mobile_no value should be retained --- erpnext/crm/doctype/lead/lead.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index d1d096843b..ce3de40fc3 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -168,12 +168,13 @@ class Lead(SellingController): if self.phone: contact.append("phone_nos", { "phone": self.phone, - "is_primary": 1 + "is_primary_phone": 1 }) if self.mobile_no: contact.append("phone_nos", { - "phone": self.mobile_no + "phone": self.mobile_no, + "is_primary_mobile_no":1 }) contact.insert(ignore_permissions=True)