[fix] Fetch UOM Conversion Factor from template if not specified in variants

This commit is contained in:
Nabin Hait 2015-10-07 11:55:01 +05:30
parent bcd655a985
commit 314086d6c0

View File

@ -346,8 +346,7 @@ def get_conversion_factor(item_code, uom):
variant_of = frappe.db.get_value("Item", item_code, "variant_of")
filters = {"parent": item_code, "uom": uom}
if variant_of:
filters = {"parent": ("in", (item_code, variant_of))}
filters["parent"] = ("in", (item_code, variant_of))
return {"conversion_factor": frappe.db.get_value("UOM Conversion Detail",
filters, "conversion_factor")}