From 0952df29dce359242fcbc70b122b50bdd893a942 Mon Sep 17 00:00:00 2001 From: Felipe Orellana Date: Wed, 17 May 2017 09:50:01 -0400 Subject: [PATCH] Update product.py (#8877) Hi! If template_item_code is None on line 71-72 the query will return ALL "Item Price" records irrespective of item_code, potentially causing the wrong price list rate to be used. Noticed this behavior when fetching product price for a group of items without "variant_of" data. --- erpnext/shopping_cart/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/shopping_cart/product.py b/erpnext/shopping_cart/product.py index d7afc3bfba..1999a4aa43 100644 --- a/erpnext/shopping_cart/product.py +++ b/erpnext/shopping_cart/product.py @@ -67,7 +67,7 @@ def get_price(item_code, template_item_code, price_list, qty=1): price = frappe.get_all("Item Price", fields=["price_list_rate", "currency"], filters={"price_list": price_list, "item_code": item_code}) - if not price: + if template_item_code and not price: price = frappe.get_all("Item Price", fields=["price_list_rate", "currency"], filters={"price_list": price_list, "item_code": template_item_code})