fix: assigning to new owner and revoking old assignees permissions
This commit is contained in:
parent
068edf8737
commit
981e96be7c
@ -18,9 +18,11 @@ class CRMDeal(Document):
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
self.set_primary_contact()
|
self.set_primary_contact()
|
||||||
self.set_primary_email_mobile_no()
|
self.set_primary_email_mobile_no()
|
||||||
if self.deal_owner and not self.is_new():
|
if not self.is_new():
|
||||||
self.share_with_agent(self.deal_owner)
|
curr_owner = frappe.db.get_value(self.doctype,self.name,"deal_owner")
|
||||||
self.assign_agent(self.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 self.has_value_changed("status"):
|
if self.has_value_changed("status"):
|
||||||
add_status_change_log(self)
|
add_status_change_log(self)
|
||||||
|
|
||||||
|
|||||||
@ -21,9 +21,11 @@ class CRMLead(Document):
|
|||||||
self.set_lead_name()
|
self.set_lead_name()
|
||||||
self.set_title()
|
self.set_title()
|
||||||
self.validate_email()
|
self.validate_email()
|
||||||
if self.lead_owner and not self.is_new():
|
if not self.is_new():
|
||||||
self.share_with_agent(self.lead_owner)
|
curr_owner = frappe.db.get_value(self.doctype,self.name,"lead_owner")
|
||||||
self.assign_agent(self.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 self.has_value_changed("status"):
|
if self.has_value_changed("status"):
|
||||||
add_status_change_log(self)
|
add_status_change_log(self)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user