Skip to content

Commit

Permalink
Update crm/fcrm/doctype/crm_lead/crm_lead.py
Browse files Browse the repository at this point in the history
Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com>
  • Loading branch information
pu-raihan and shariquerik authored Oct 21, 2024
1 parent ef41bc0 commit 0d25867
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crm/fcrm/doctype/crm_lead/crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ def validate(self):
self.set_lead_name()
self.set_title()
self.validate_email()
if not self.is_new():
curr_owner = frappe.db.get_value(self.doctype,self.name,"lead_owner")
if self.lead_owner and self.lead_owner != curr_owner:
self.share_with_agent(self.lead_owner)
self.assign_agent(self.lead_owner)
if not self.is_new() and self.has_value_changed("lead_owner") and self.lead_owner:
self.share_with_agent(self.lead_owner)
self.assign_agent(self.lead_owner)
if self.has_value_changed("status"):
add_status_change_log(self)

Expand Down

0 comments on commit 0d25867

Please sign in to comment.