Merge pull request #4136 from nabinhait/uom

[fix] Fetch UOM Conversion Factor from template if not specified in variants
This commit is contained in:
Nabin Hait 2015-10-07 14:30:18 +05:30
commit 714948c867

View File

@ -346,8 +346,7 @@ def get_conversion_factor(item_code, uom):
variant_of = frappe.db.get_value("Item", item_code, "variant_of") variant_of = frappe.db.get_value("Item", item_code, "variant_of")
filters = {"parent": item_code, "uom": uom} filters = {"parent": item_code, "uom": uom}
if variant_of: 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", return {"conversion_factor": frappe.db.get_value("UOM Conversion Detail",
filters, "conversion_factor")} filters, "conversion_factor")}