From a59f8640d15006481ab1864c392ffe51877b7780 Mon Sep 17 00:00:00 2001 From: kasgel Date: Sat, 5 Sep 2020 12:15:49 +0200 Subject: [PATCH] fix: pass stock_qty to get_pricing_rule_for_item get_pricing_rule_for_item uses the "stock_qty" and "qty" arguments to filter pricing rules. Not passing stock_qty prevents for example the shopping cart from filtering pricing rules appropriately based on Quantity. --- erpnext/utilities/product.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/utilities/product.py b/erpnext/utilities/product.py index c23c1f7096..66d6cd3888 100644 --- a/erpnext/utilities/product.py +++ b/erpnext/utilities/product.py @@ -82,6 +82,7 @@ def get_price(item_code, price_list, customer_group, company, qty=1): pricing_rule = get_pricing_rule_for_item(frappe._dict({ "item_code": item_code, "qty": qty, + "stock_qty": qty, "transaction_type": "selling", "price_list": price_list, "customer_group": customer_group,