perf: cached get_last_purchase_details to fix performance issue (#39854) (cherry picked from commit b966c06a4f7ec1d64e475a626ee934695c77a2a4) Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
parent
4daee6d9c7
commit
c643e70e2f
@ -942,6 +942,9 @@ class StockController(AccountsController):
|
|||||||
"Stock Reconciliation",
|
"Stock Reconciliation",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not frappe.get_all("Putaway Rule", limit=1):
|
||||||
|
return
|
||||||
|
|
||||||
if self.doctype == "Purchase Invoice" and self.get("update_stock") == 0:
|
if self.doctype == "Purchase Invoice" and self.get("update_stock") == 0:
|
||||||
valid_doctype = False
|
valid_doctype = False
|
||||||
|
|
||||||
|
|||||||
@ -1122,6 +1122,7 @@ def validate_cancelled_item(item_code, docstatus=None):
|
|||||||
frappe.throw(_("Item {0} is cancelled").format(item_code))
|
frappe.throw(_("Item {0} is cancelled").format(item_code))
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.request_cache
|
||||||
def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0):
|
def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0):
|
||||||
"""returns last purchase details in stock uom"""
|
"""returns last purchase details in stock uom"""
|
||||||
# get last purchase order item details
|
# get last purchase order item details
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user