Merge pull request #39742 from rohitwaghchaure/fixed-performance-issue-9247
perf: timeout while submitting the purchase receipt entry
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index 656ee9b..4d94868 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -645,6 +645,7 @@
update_sco_status(sco, "Closed" if self.status == "Closed" else None)
+@frappe.request_cache
def item_last_purchase_rate(name, conversion_rate, item_code, conversion_factor=1.0):
"""get last purchase rate for an item"""