From 5c5ec3c4920e3d7d3958af8f125c3bfb25630080 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 17 Jan 2024 11:44:25 +0530 Subject: [PATCH] fix: assign agent logic --- crm/fcrm/doctype/crm_deal/crm_deal.py | 4 ++-- crm/fcrm/doctype/crm_lead/crm_lead.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index 21d5cd08..a69478a2 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -86,8 +86,8 @@ class CRMDeal(Document): if not agent: return - if self._assign: - assignees = json.loads(self._assign) + assignees = self.get_assigned_users() + if assignees: for assignee in assignees: if agent == assignee: # the agent is already set as an assignee diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py index 7b8af194..51bd18eb 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.py +++ b/crm/fcrm/doctype/crm_lead/crm_lead.py @@ -69,8 +69,8 @@ class CRMLead(Document): if not agent: return - if self.get("_assign"): - assignees = json.loads(self._assign) + assignees = self.get_assigned_users() + if assignees: for assignee in assignees: if agent == assignee: # the agent is already set as an assignee