perf: index for item-sh on repost item valuation
Item-WH based reposting requires querying existing similar repost. Assuming there is only 1 max extra entry with same params just indexing item-WH is sufficient to speed up the query.
This commit is contained in:
parent
45dd46be3d
commit
a5a8c9104f
@ -177,7 +177,7 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2021-11-18 02:18:10.524560",
|
||||
"modified": "2021-11-24 02:18:10.524560",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Repost Item Valuation",
|
||||
|
@ -58,6 +58,11 @@ class RepostItemValuation(Document):
|
||||
frappe.enqueue(repost, timeout=1800, queue='long',
|
||||
job_name='repost_sle', now=True, doc=self)
|
||||
|
||||
|
||||
def on_doctype_update():
|
||||
frappe.db.add_index("Repost Item Valuation", ["warehouse", "item_code"], "item_warehouse")
|
||||
|
||||
|
||||
def repost(doc):
|
||||
try:
|
||||
if not frappe.db.exists("Repost Item Valuation", doc.name):
|
||||
|
Loading…
x
Reference in New Issue
Block a user