fix: single column indexes (#32425)
refactor: move single column indexes to doctypes
diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json
index 6f8b382..eedaaaf 100644
--- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json
+++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json
@@ -343,7 +343,8 @@
"no_copy": 1,
"options": "POS Invoice",
"print_hide": 1,
- "read_only": 1
+ "read_only": 1,
+ "search_index": 1
},
{
"default": "0",
@@ -1553,7 +1554,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
- "modified": "2022-09-27 13:00:24.166684",
+ "modified": "2022-09-30 03:49:50.455199",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",
diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py
index fbe0ef3..54a3e93 100644
--- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py
+++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py
@@ -743,7 +743,3 @@
]:
payment_mode = get_mode_of_payment_info(mode_of_payment, doc.company)
append_payment(payment_mode[0])
-
-
-def on_doctype_update():
- frappe.db.add_index("POS Invoice", ["return_against"])
diff --git a/erpnext/e_commerce/doctype/website_item/website_item.json b/erpnext/e_commerce/doctype/website_item/website_item.json
index c5775ee..6556eab 100644
--- a/erpnext/e_commerce/doctype/website_item/website_item.json
+++ b/erpnext/e_commerce/doctype/website_item/website_item.json
@@ -188,7 +188,8 @@
"in_list_view": 1,
"label": "Item Group",
"options": "Item Group",
- "read_only": 1
+ "read_only": 1,
+ "search_index": 1
},
{
"default": "1",
@@ -234,7 +235,8 @@
"fieldname": "brand",
"fieldtype": "Link",
"label": "Brand",
- "options": "Brand"
+ "options": "Brand",
+ "search_index": 1
},
{
"collapsible": 1,
@@ -346,7 +348,7 @@
"index_web_pages_for_search": 1,
"links": [],
"make_attachments_public": 1,
- "modified": "2022-09-13 04:05:11.614087",
+ "modified": "2022-09-30 04:01:52.090732",
"modified_by": "Administrator",
"module": "E-commerce",
"name": "Website Item",
diff --git a/erpnext/e_commerce/doctype/website_item/website_item.py b/erpnext/e_commerce/doctype/website_item/website_item.py
index c0f8c79..3e5d5f7 100644
--- a/erpnext/e_commerce/doctype/website_item/website_item.py
+++ b/erpnext/e_commerce/doctype/website_item/website_item.py
@@ -403,9 +403,6 @@
# since route is a Text column, it needs a length for indexing
frappe.db.add_index("Website Item", ["route(500)"])
- frappe.db.add_index("Website Item", ["item_group"])
- frappe.db.add_index("Website Item", ["brand"])
-
def check_if_user_is_customer(user=None):
from frappe.contacts.doctype.contact.contact import get_contact_name