From 7ab241fab4e7e7c964f3cf0bee0785b2de8cbc5e Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 2 Jan 2025 22:29:31 +0530 Subject: [PATCH] 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 4f690affc94d7a11ba601938a77ccf1ff01a3323) # Conflicts: # erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py --- .../repost_item_valuation/repost_item_valuation.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py index c9572d12b64..58c7427470c 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -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(