Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: assigning to new owner and revoking old assignees permissions upon lead_owner change #418

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

pu-raihan
Copy link
Contributor

This PR is a fix to this issue #417
Previously the share permissions were revoked from the assignees each time the lead and deal get evaluated.
this PR checks if the owner of doc has changed and then revokes the perms.

Code Changed

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant