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,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-11-18 02:18:10.524560",
|
"modified": "2021-11-24 02:18:10.524560",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Repost Item Valuation",
|
"name": "Repost Item Valuation",
|
||||||
@ -228,4 +228,4 @@
|
|||||||
],
|
],
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC"
|
"sort_order": "DESC"
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,11 @@ class RepostItemValuation(Document):
|
|||||||
frappe.enqueue(repost, timeout=1800, queue='long',
|
frappe.enqueue(repost, timeout=1800, queue='long',
|
||||||
job_name='repost_sle', now=True, doc=self)
|
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):
|
def repost(doc):
|
||||||
try:
|
try:
|
||||||
if not frappe.db.exists("Repost Item Valuation", doc.name):
|
if not frappe.db.exists("Repost Item Valuation", doc.name):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user