From 61f3ea5e174110a691469f78a6533a03eb4ad205 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Fri, 1 Sep 2023 17:50:09 +0530 Subject: [PATCH] fix: update contact image if lead image is updated --- crm/crm/doctype/crm_lead/crm_lead.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crm/crm/doctype/crm_lead/crm_lead.py b/crm/crm/doctype/crm_lead/crm_lead.py index c508f0539..6e0b54220 100644 --- a/crm/crm/doctype/crm_lead/crm_lead.py +++ b/crm/crm/doctype/crm_lead/crm_lead.py @@ -51,7 +51,7 @@ def validate_contact(self): link = frappe.db.exists("Dynamic Link", {"link_doctype": "CRM Lead", "link_name": self.name}) if link: - for field in ["first_name", "last_name", "email", "mobile_no", "phone", "salutation"]: + for field in ["first_name", "last_name", "email", "mobile_no", "phone", "salutation", "image"]: if self.has_value_changed(field): contact = frappe.db.get_value("Dynamic Link", link, "parent") contact_doc = frappe.get_doc("Contact", contact) @@ -59,6 +59,7 @@ def validate_contact(self): "first_name": self.first_name or self.lead_name, "last_name": self.last_name, "salutation": self.salutation, + "image": self.image or "", }) if self.has_value_changed("email"): contact_doc.email_ids = [] @@ -106,6 +107,7 @@ def create_contact(self): "gender": self.gender, "designation": self.job_title, "company_name": self.organization_name, + "image": self.image or "", } )