From 7d9689cc9218cd2c305ceaaf5515dd3232db8ffa Mon Sep 17 00:00:00 2001 From: Britlog Date: Tue, 13 Nov 2018 07:06:41 +0100 Subject: [PATCH] [Fix] Website Conversion factor query (#15866) * [Fix] Conversion factor query * Update product.py --- erpnext/utilities/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/utilities/product.py b/erpnext/utilities/product.py index 6f984a501b..a2867c8806 100644 --- a/erpnext/utilities/product.py +++ b/erpnext/utilities/product.py @@ -108,8 +108,8 @@ def get_price(item_code, price_list, customer_group, company, qty=1): uom_conversion_factor = frappe.db.sql("""select C.conversion_factor from `tabUOM Conversion Detail` C - inner join `tabItem` I on C.uom = I.sales_uom - where C.parent = %s""", item_code) + inner join `tabItem` I on C.parent = I.name and C.uom = I.sales_uom + where I.name = %s""", item_code) uom_conversion_factor = uom_conversion_factor[0][0] if uom_conversion_factor else 1 price_obj["formatted_price_sales_uom"] = fmt_money(price_obj["price_list_rate"] * uom_conversion_factor, currency=price_obj["currency"])