From 38679d6d147b098adf83ab7466697d5752cef9ea Mon Sep 17 00:00:00 2001 From: SowmyaArunachalam Date: Thu, 12 Feb 2026 13:22:17 +0530 Subject: [PATCH 1/2] fix: consider table multiselect in delete transaction (cherry picked from commit be3d2422a7e1116fb5c4ad35edd2c3d679d94115) --- .../transaction_deletion_record.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py index b308453c847..245befce842 100644 --- a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py +++ b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py @@ -317,7 +317,9 @@ class TransactionDeletionRecord(Document): list: List of child table DocType names (Table field options) """ return frappe.get_all( - "DocField", filters={"parent": doctype_name, "fieldtype": "Table"}, pluck="options" + "DocField", + filters={"parent": doctype_name, "fieldtype": ["in", ["Table", "Table MultiSelect"]]}, + pluck="options", ) def _get_to_delete_row_infos(self, doctype_name, company_field=None, company=None): From 3c33a19634cca72e206db05953f97e662ed2969c Mon Sep 17 00:00:00 2001 From: SowmyaArunachalam Date: Thu, 12 Feb 2026 13:26:47 +0530 Subject: [PATCH 2/2] fix: removed lost reason detail (cherry picked from commit 9bb60405e70bdc6c76ebcc5bc739cdf658e108a4) # Conflicts: # erpnext/patches.txt --- 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 838c837321e..e6d090dac21 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -464,3 +464,4 @@ erpnext.patches.v16_0.set_ordered_qty_in_quotation_item erpnext.patches.v16_0.migrate_transaction_deletion_task_flags_to_status # 2 erpnext.patches.v16_0.update_company_custom_field_in_bin erpnext.patches.v15_0.replace_http_with_https_in_sales_partner +erpnext.patches.v15_0.delete_quotation_lost_record_detail 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()