From df42348d39e47de15bb80069d4650f15cb4911ee Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 18 Sep 2025 13:08:26 +0530 Subject: [PATCH] fix: drop index batch_no_item_code_warehouse_index (cherry picked from commit 28180ccaa42cf1e1ebb4b947c1970fdc931624a0) --- erpnext/patches.txt | 2 +- erpnext/patches/v15_0/drop_sle_indexes.py | 2 +- erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index fd3dc3ad3cd..d4b708cdf2e 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -408,7 +408,7 @@ erpnext.patches.v14_0.set_update_price_list_based_on erpnext.patches.v15_0.set_cancelled_status_to_cancelled_pos_invoice erpnext.patches.v15_0.rename_group_by_to_categorize_by_in_custom_reports erpnext.patches.v14_0.update_full_name_in_contract -erpnext.patches.v15_0.drop_sle_indexes +erpnext.patches.v15_0.drop_sle_indexes #2025-09-18 erpnext.patches.v15_0.update_pick_list_fields erpnext.patches.v15_0.update_pegged_currencies erpnext.patches.v15_0.set_company_on_pos_inv_merge_log diff --git a/erpnext/patches/v15_0/drop_sle_indexes.py b/erpnext/patches/v15_0/drop_sle_indexes.py index 8e18245b1a5..0b8147defee 100644 --- a/erpnext/patches/v15_0/drop_sle_indexes.py +++ b/erpnext/patches/v15_0/drop_sle_indexes.py @@ -4,7 +4,7 @@ import frappe def execute(): table = "tabStock Ledger Entry" - index_list = ["posting_datetime_creation_index", "item_warehouse"] + index_list = ["posting_datetime_creation_index", "item_warehouse", "batch_no_item_code_warehouse_index"] for index in index_list: if not frappe.db.has_index(table, index): diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py index ddef027d0b8..98a99b60d9b 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py @@ -347,5 +347,4 @@ class StockLedgerEntry(Document): def on_doctype_update(): frappe.db.add_index("Stock Ledger Entry", ["voucher_no", "voucher_type"]) - frappe.db.add_index("Stock Ledger Entry", ["batch_no", "item_code", "warehouse"]) frappe.db.add_index("Stock Ledger Entry", ["item_code", "warehouse", "posting_datetime", "creation"])