From f8bbcab3a517b1f1bc06968bd49e239a7f2e6ea1 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 21:36:57 +0530 Subject: [PATCH] fix(patch): Ensure SLE indexes (backport #46131) (#46134) * fix(patch): Ensure SLE indexes (#46131) Because of the way this change was pushed in parts, some sites don't see this as "update" and don't have the new indexes. (cherry picked from commit f62aa8fc57dcf4f2d4282811db1c85ff4259a2a5) # Conflicts: # erpnext/patches.txt * fix: resolved conflict --------- Co-authored-by: Ankush Menat Co-authored-by: Nabin Hait --- erpnext/patches.txt | 2 +- .../stock/doctype/stock_ledger_entry/patches/__init__.py | 0 .../stock_ledger_entry/patches/ensure_sle_indexes.py | 9 +++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 erpnext/stock/doctype/stock_ledger_entry/patches/__init__.py create mode 100644 erpnext/stock/doctype/stock_ledger_entry/patches/ensure_sle_indexes.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index ab842095412..cdec75b64ec 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -371,4 +371,4 @@ erpnext.patches.v14_0.update_stock_uom_in_work_order_item erpnext.patches.v14_0.disable_add_row_in_gross_profit execute:frappe.db.set_single_value("Accounts Settings", "exchange_gain_loss_posting_date", "Payment") erpnext.patches.v14_0.update_posting_datetime - +erpnext.stock.doctype.stock_ledger_entry.patches.ensure_sle_indexes diff --git a/erpnext/stock/doctype/stock_ledger_entry/patches/__init__.py b/erpnext/stock/doctype/stock_ledger_entry/patches/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/stock/doctype/stock_ledger_entry/patches/ensure_sle_indexes.py b/erpnext/stock/doctype/stock_ledger_entry/patches/ensure_sle_indexes.py new file mode 100644 index 00000000000..7f29b27af3f --- /dev/null +++ b/erpnext/stock/doctype/stock_ledger_entry/patches/ensure_sle_indexes.py @@ -0,0 +1,9 @@ +from erpnext.stock.doctype.stock_ledger_entry.stock_ledger_entry import ( + on_doctype_update as create_sle_indexes, +) + + +def execute(): + """Ensure SLE Indexes""" + + create_sle_indexes()