Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: index return_against on delivery note (backport #38827) #38832

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions erpnext/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,4 @@ erpnext.patches.v14_0.update_zero_asset_quantity_field
execute:frappe.db.set_single_value("Buying Settings", "project_update_frequency", "Each Transaction")
# below migration patch should always run last
erpnext.patches.v14_0.migrate_gl_to_payment_ledger
erpnext.stock.doctype.delivery_note.patches.drop_unused_return_against_index
5 changes: 3 additions & 2 deletions erpnext/stock/doctype/delivery_note/delivery_note.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@
"no_copy": 1,
"options": "Delivery Note",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"collapsible": 1,
Expand Down Expand Up @@ -1401,7 +1402,7 @@
"idx": 146,
"is_submittable": 1,
"links": [],
"modified": "2023-09-04 14:15:28.363184",
"modified": "2023-12-18 17:19:39.368239",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
Expand Down
4 changes: 0 additions & 4 deletions erpnext/stock/doctype/delivery_note/delivery_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,3 @@ def update_details(source_doc, target_doc, source_parent):
)

return doclist


def on_doctype_update():
frappe.db.add_index("Delivery Note", ["customer", "is_return", "return_against"])
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import frappe


def execute():
"""Drop unused return_against index"""

try:
frappe.db.sql_ddl(
"ALTER TABLE `tabDelivery Note` DROP INDEX `customer_is_return_return_against_index`"
)
frappe.db.sql_ddl(
"ALTER TABLE `tabPurchase Receipt` DROP INDEX `supplier_is_return_return_against_index`"
)
except Exception:
frappe.log_error("Failed to drop unused index")
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@
"no_copy": 1,
"options": "Purchase Receipt",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"fieldname": "section_addresses",
Expand Down Expand Up @@ -1251,7 +1252,7 @@
"idx": 261,
"is_submittable": 1,
"links": [],
"modified": "2023-11-28 13:14:15.243474",
"modified": "2023-12-18 17:26:41.279663",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
Expand Down
4 changes: 0 additions & 4 deletions erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,10 +1357,6 @@ def get_item_account_wise_additional_cost(purchase_document):
return item_account_wise_cost


def on_doctype_update():
frappe.db.add_index("Purchase Receipt", ["supplier", "is_return", "return_against"])


@erpnext.allow_regional
def update_regional_gl_entries(gl_list, doc):
return
Loading