perf: query one item price only

This commit is contained in:
barredterra
2024-03-20 19:37:34 +01:00
parent 1714ac6587
commit be9fe7331a

View File

@@ -911,6 +911,7 @@ def get_item_price(args, item_code, ignore_party=False):
.orderby(ip.valid_from, order=frappe.qb.desc)
.orderby(IfNull(ip.batch_no, ""), order=frappe.qb.desc)
.orderby(ip.uom, order=frappe.qb.desc)
.limit(1)
)
if not ignore_party: