diff --git a/frappe/handler.py b/frappe/handler.py index 7f03e1db4f..6fe96e62a9 100644 --- a/frappe/handler.py +++ b/frappe/handler.py @@ -217,7 +217,7 @@ def check_write_permission(doctype: str | None = None, name: str | None = None): except frappe.DoesNotExistError: # doc has not been inserted yet, name is set to "new-some-doctype" # If doc inserts fine then only this attachment will be linked see file/utils.py:relink_mismatched_files - check_doctype_permission(doctype, "write") + frappe.new_doc(doctype).check_permission("write") return doc.check_permission("write")