perf: add basic optimisation for uom conversion

This commit is contained in:
Ankush Menat 2021-05-23 00:17:08 +05:30
parent 958d485ba4
commit 297dc5e345
No known key found for this signature in database
GPG Key ID: 8EA82E09BBD13AAF

View File

@ -1244,6 +1244,9 @@ def get_item_details(item_code, company=None):
@frappe.whitelist()
def get_uom_conv_factor(uom, stock_uom):
if uom == stock_uom:
return 1.0
uoms = [uom, stock_uom]
value = ""
uom_details = frappe.db.sql("""select to_uom, from_uom, value from `tabUOM Conversion Factor`\