Skip to content

Commit 253e7a9

Browse files
mergify[bot]mihir-kandoidiptanilsaha
authored
fix: add validation in bom creator function (backport #53364) (#53463)
* fix: add validation in bom creator function (#53364) (cherry picked from commit 9c0c393) # Conflicts: # erpnext/manufacturing/doctype/bom_creator/bom_creator.py * chore: resolve conflict --------- Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com> Co-authored-by: diptanilsaha <diptanil@frappe.io>
1 parent c791d28 commit 253e7a9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

erpnext/manufacturing/doctype/bom_creator/bom_creator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,10 @@ def delete_node(**kwargs):
561561

562562

563563
@frappe.whitelist()
564-
def edit_bom_creator(doctype, docname, data, parent):
564+
def edit_bom_creator(doctype: str, docname: str, data: str | dict, parent: str):
565+
if not frappe.has_permission(doctype=doctype, ptype="write", parent_doctype="BOM Creator"):
566+
frappe.throw(_("You do not have permission to edit this document"), frappe.PermissionError)
567+
565568
if isinstance(data, str):
566569
data = frappe.parse_json(data)
567570

0 commit comments

Comments
 (0)