From ef41bc076c150c797505f24474ec54090a2e1251 Mon Sep 17 00:00:00 2001 From: Muhammed Raihan P A <99407382+pu-raihan@users.noreply.github.com> Date: Mon, 21 Oct 2024 08:55:06 -0800 Subject: [PATCH] Update crm/fcrm/doctype/crm_deal/crm_deal.py Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com> --- crm/fcrm/doctype/crm_deal/crm_deal.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index 4d2251cf..dc18c133 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -18,11 +18,9 @@ class CRMDeal(Document): def validate(self): self.set_primary_contact() self.set_primary_email_mobile_no() - if not self.is_new(): - curr_owner = frappe.db.get_value(self.doctype,self.name,"deal_owner") - if self.deal_owner and self.deal_owner != curr_owner: - self.share_with_agent(self.deal_owner) - self.assign_agent(self.deal_owner) + if not self.is_new() and self.has_value_changed("deal_owner") and self.deal_owner: + self.share_with_agent(self.deal_owner) + self.assign_agent(self.deal_owner) if self.has_value_changed("status"): add_status_change_log(self)