mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-05 19:42:45 +00:00
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.
(cherry picked from commit a5a8c9104f)
This commit is contained in:
committed by
mergify-bot
parent
7ae5bc8911
commit
21f64e5eba
@@ -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",
|
||||
@@ -228,4 +228,4 @@
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,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):
|
||||
|
||||
Reference in New Issue
Block a user