perf: add basic optimisation for uom conversion
This commit is contained in:
parent
958d485ba4
commit
297dc5e345
@ -1244,6 +1244,9 @@ def get_item_details(item_code, company=None):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_uom_conv_factor(uom, stock_uom):
|
def get_uom_conv_factor(uom, stock_uom):
|
||||||
|
if uom == stock_uom:
|
||||||
|
return 1.0
|
||||||
|
|
||||||
uoms = [uom, stock_uom]
|
uoms = [uom, stock_uom]
|
||||||
value = ""
|
value = ""
|
||||||
uom_details = frappe.db.sql("""select to_uom, from_uom, value from `tabUOM Conversion Factor`\
|
uom_details = frappe.db.sql("""select to_uom, from_uom, value from `tabUOM Conversion Factor`\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user