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 3c63fffcb6
commit 2cc1a51d9a

View File

@@ -526,8 +526,11 @@ def get_lead_with_phone_number(number):
return lead
@frappe.whitelist()
def add_lead_to_prospect(lead, prospect):
@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()