mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-20 03:47:11 +00:00
fix(accounts): add permission checks on send_proforma_email (#58933)
This commit is contained in:
@@ -212,6 +212,7 @@ def _proforma_line(so_item, based_on: str, row: dict) -> dict | None:
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def send_proforma_email(proforma_name: str, recipients: str) -> None:
|
def send_proforma_email(proforma_name: str, recipients: str) -> None:
|
||||||
proforma = frappe.get_doc("Proforma Invoice", proforma_name)
|
proforma = frappe.get_doc("Proforma Invoice", proforma_name)
|
||||||
|
proforma.check_permission("email")
|
||||||
if proforma.docstatus != 1:
|
if proforma.docstatus != 1:
|
||||||
frappe.throw(_("Only an issued Proforma Invoice can be emailed."))
|
frappe.throw(_("Only an issued Proforma Invoice can be emailed."))
|
||||||
if not proforma.proforma_pdf:
|
if not proforma.proforma_pdf:
|
||||||
|
|||||||
Reference in New Issue
Block a user