mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-15 01:43:10 +00:00
perf: composite index on (serial_no, warehouse, posting_datetime)
This commit is contained in:
@@ -488,3 +488,4 @@ erpnext.patches.v16_0.rename_secondary_item_type_field
|
|||||||
erpnext.patches.v16_0.submit_existing_product_bundles #1
|
erpnext.patches.v16_0.submit_existing_product_bundles #1
|
||||||
erpnext.patches.v16_0.migrate_subscription_generate_invoice_at
|
erpnext.patches.v16_0.migrate_subscription_generate_invoice_at
|
||||||
erpnext.patches.v16_0.rename_subscription_billing_period_fields
|
erpnext.patches.v16_0.rename_subscription_billing_period_fields
|
||||||
|
erpnext.patches.v16_0.drop_redundant_serial_no_index_from_sabb
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
from frappe.database.utils import drop_index_if_exists
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
drop_index_if_exists("tabSerial and Batch Entry", "serial_no")
|
||||||
|
drop_index_if_exists("tabSerial and Batch Entry", "warehouse")
|
||||||
|
drop_index_if_exists("tabSerial and Batch Entry", "type_of_transaction")
|
||||||
@@ -37,8 +37,7 @@
|
|||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Serial No",
|
"label": "Serial No",
|
||||||
"options": "Serial No",
|
"options": "Serial No"
|
||||||
"search_index": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval:parent.has_batch_no == 1",
|
"depends_on": "eval:parent.has_batch_no == 1",
|
||||||
@@ -62,8 +61,7 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Warehouse",
|
"label": "Warehouse",
|
||||||
"options": "Warehouse",
|
"options": "Warehouse"
|
||||||
"search_index": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_2",
|
"fieldname": "column_break_2",
|
||||||
@@ -178,8 +176,7 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Type of Transaction",
|
"label": "Type of Transaction",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"read_only": 1,
|
"read_only": 1
|
||||||
"search_index": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_eykr",
|
"fieldname": "column_break_eykr",
|
||||||
|
|||||||
@@ -42,3 +42,4 @@ class SerialandBatchEntry(Document):
|
|||||||
|
|
||||||
def on_doctype_update():
|
def on_doctype_update():
|
||||||
frappe.db.add_index("Serial and Batch Entry", ["warehouse", "batch_no", "posting_datetime"])
|
frappe.db.add_index("Serial and Batch Entry", ["warehouse", "batch_no", "posting_datetime"])
|
||||||
|
frappe.db.add_index("Serial and Batch Entry", ["warehouse", "serial_no", "posting_datetime"])
|
||||||
|
|||||||
Reference in New Issue
Block a user