From 3955fa5102313a904c6189a436aa5e0e09b64c3b Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 11 Jan 2018 18:21:02 +0530 Subject: [PATCH] [Fix] Email addres unique key issue (#12450) --- erpnext/selling/doctype/customer/customer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 9c2545b39c..6c9e4501f8 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -66,7 +66,7 @@ class Customer(TransactionBase): self.create_lead_address_contact() def create_primary_contact(self): - if not self.customer_primary_contact: + if not self.customer_primary_contact and not self.lead_name: if self.mobile_no or self.email_id: contact = make_contact(self) self.db_set('customer_primary_contact', contact.name)