Skip to content

Commit

Permalink
fix: single column indexes (#32425)
Browse files Browse the repository at this point in the history
fix: single column indexes (#32425)

refactor: move single column indexes to doctypes
(cherry picked from commit 8d1db0e)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Jul 10, 2023
1 parent cf3ec93 commit 53f7764
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 3 additions & 2 deletions erpnext/accounts/doctype/pos_invoice/pos_invoice.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@
"no_copy": 1,
"options": "POS Invoice",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"default": "0",
Expand Down Expand Up @@ -1572,7 +1573,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",
Expand Down
4 changes: 0 additions & 4 deletions erpnext/accounts/doctype/pos_invoice/pos_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,3 @@ def append_payment(payment_mode):
]:
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"])
8 changes: 5 additions & 3 deletions erpnext/e_commerce/doctype/website_item/website_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -234,7 +235,8 @@
"fieldname": "brand",
"fieldtype": "Link",
"label": "Brand",
"options": "Brand"
"options": "Brand",
"search_index": 1
},
{
"collapsible": 1,
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 0 additions & 3 deletions erpnext/e_commerce/doctype/website_item/website_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,6 @@ def on_doctype_update():
# 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
Expand Down

0 comments on commit 53f7764

Please sign in to comment.