From 193a81be8f58b7c9365bda7e204fca83ddac9b56 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 29 May 2024 12:49:43 +0530 Subject: [PATCH] fix: reset first_response_time & first_responded_on if set from communication.py --- crm/fcrm/doctype/crm_deal/crm_deal.py | 4 ++++ crm/fcrm/doctype/crm_lead/crm_lead.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index e9a1dd61..901f2179 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -106,8 +106,12 @@ class CRMDeal(Document): """ Find an SLA to apply to the deal. """ + if self.sla: return + sla = get_sla(self) if not sla: + self.first_responded_on = None + self.first_response_time = None return self.sla = sla.name diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py index 6d26d1d1..f4ebe162 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.py +++ b/crm/fcrm/doctype/crm_lead/crm_lead.py @@ -232,8 +232,12 @@ class CRMLead(Document): """ Find an SLA to apply to the lead. """ + if self.sla: return + sla = get_sla(self) if not sla: + self.first_responded_on = None + self.first_response_time = None return self.sla = sla.name