mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-28 01:14:46 +00:00
perf: use estimated count on item table
This commit is contained in:
@@ -236,7 +236,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals
|
|||||||
filters.pop("supplier", None)
|
filters.pop("supplier", None)
|
||||||
|
|
||||||
description_cond = ""
|
description_cond = ""
|
||||||
if frappe.db.count(doctype, cache=True) < 50000:
|
if frappe.db.estimate_count(doctype) < 50000:
|
||||||
# scan description only if items are less than 50000
|
# scan description only if items are less than 50000
|
||||||
description_cond = "or tabItem.description LIKE %(txt)s"
|
description_cond = "or tabItem.description LIKE %(txt)s"
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ class TestInventoryDimension(IntegrationTestCase):
|
|||||||
|
|
||||||
def test_inventory_dimension_for_purchase_receipt_and_delivery_note(self):
|
def test_inventory_dimension_for_purchase_receipt_and_delivery_note(self):
|
||||||
frappe.clear_cache(doctype="Inventory Dimension")
|
frappe.clear_cache(doctype="Inventory Dimension")
|
||||||
frappe.clear_cache("Inventory Dimension")
|
|
||||||
|
|
||||||
inv_dimension = create_inventory_dimension(
|
inv_dimension = create_inventory_dimension(
|
||||||
reference_document="Rack", dimension_name="Rack", apply_to_all_doctypes=1
|
reference_document="Rack", dimension_name="Rack", apply_to_all_doctypes=1
|
||||||
|
|||||||
Reference in New Issue
Block a user