perf: Skip link checking on repost's remove_attached_file (#45061)

This is internal detail, doesn't need to do horrible link checks in
framework.

(cherry picked from commit 4f690affc9)

# Conflicts:
#	erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py
This commit is contained in:
Ankush Menat
2025-01-02 22:29:31 +05:30
committed by Mergify
parent 3993525bf6
commit 7ab241fab4

View File

@@ -266,6 +266,16 @@ def repost(doc):
frappe.db.commit()
<<<<<<< HEAD
=======
def remove_attached_file(docname):
if file_name := frappe.db.get_value(
"File", {"attached_to_name": docname, "attached_to_doctype": "Repost Item Valuation"}, "name"
):
frappe.delete_doc("File", file_name, ignore_permissions=True, delete_permanently=True, force=True)
>>>>>>> 4f690affc9 (perf: Skip link checking on repost's remove_attached_file (#45061))
def repost_sl_entries(doc):
if doc.based_on == "Transaction":
repost_future_sle(