fix(crm): check read permission on lead in add_lead_to_prospect

(cherry picked from commit 02fcdc0337)

# Conflicts:
#	erpnext/crm/doctype/lead/lead.py
This commit is contained in:
Shllokkk
2026-09-02 13:50:38 +05:30
parent 3217a69fc2
commit 4dd56ec4e6

View File

@@ -516,8 +516,11 @@ def get_lead_with_phone_number(number):
return lead return lead
@frappe.whitelist() @frappe.whitelist(methods=["POST"])
def add_lead_to_prospect(lead, prospect): 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 = frappe.get_doc("Prospect", prospect)
prospect.append("leads", {"lead": lead}) prospect.append("leads", {"lead": lead})
prospect.save() prospect.save()