From 9bb60405e70bdc6c76ebcc5bc739cdf658e108a4 Mon Sep 17 00:00:00 2001 From: SowmyaArunachalam Date: Thu, 12 Feb 2026 13:26:47 +0530 Subject: [PATCH] fix: removed lost reason detail --- erpnext/patches.txt | 1 + .../v15_0/delete_quotation_lost_record_detail.py | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 erpnext/patches/v15_0/delete_quotation_lost_record_detail.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 71e4e6ba806..6c5b3bf7e78 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -465,3 +465,4 @@ erpnext.patches.v16_0.set_ordered_qty_in_quotation_item erpnext.patches.v16_0.update_company_custom_field_in_bin erpnext.patches.v15_0.replace_http_with_https_in_sales_partner erpnext.patches.v16_0.migrate_asset_type_checkboxes_to_select +erpnext.patches.v15_0.delete_quotation_lost_record_detail \ No newline at end of file diff --git a/erpnext/patches/v15_0/delete_quotation_lost_record_detail.py b/erpnext/patches/v15_0/delete_quotation_lost_record_detail.py new file mode 100644 index 00000000000..2dc37486e1c --- /dev/null +++ b/erpnext/patches/v15_0/delete_quotation_lost_record_detail.py @@ -0,0 +1,11 @@ +import frappe +from frappe.query_builder import DocType + + +def execute(): + qlr = DocType("Quotation Lost Reason Detail") + quotation = DocType("Quotation") + + sub_query = frappe.qb.from_(quotation).select(quotation.name) + query = frappe.qb.from_(qlr).delete().where(qlr.parent.notin(sub_query)) + query.run()