[Fix] Website Conversion factor query (#15866)

* [Fix] Conversion factor query

* Update product.py
This commit is contained in:
Britlog 2018-11-13 07:06:41 +01:00 committed by Nabin Hait
parent 9e9e37d39b
commit 7d9689cc92

View File

@ -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"])