Merge pull request #58684 from Shllokkk/lead-add-to-prospect-read-permission-check

fix(crm): check read permission on lead in add_lead_to_prospect
This commit is contained in:
Shllokkk
2026-09-02 14:54:01 +05:30
committed by GitHub

View File

@@ -382,6 +382,9 @@ def get_lead_with_phone_number(number):
@frappe.whitelist(methods=["POST"])
def add_lead_to_prospect(lead: str, prospect: str):
if lead:
frappe.has_permission("Lead", "read", lead, throw=True)
prospect = frappe.get_doc("Prospect", prospect)
prospect.append("leads", {"lead": lead})
prospect.save()