diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index 1c539020760..b17c9952984 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -20,6 +20,7 @@ class TestPricingRule(unittest.TestCase): "price_or_discount": "Discount Percentage", "price": 0, "discount_percentage": 10, + "company": "_Test Company" } frappe.get_doc(test_record.copy()).insert() @@ -36,7 +37,6 @@ class TestPricingRule(unittest.TestCase): "transaction_type": "selling", "customer": "_Test Customer", }) - details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 10) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index fe62070640d..4a295d8242e 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -268,6 +268,7 @@ def apply_pricing_rule(args): args.supplier_type = frappe.db.get_value("Supplier", args.supplier, "supplier_type") pricing_rules = get_pricing_rules(args) + pricing_rule = filter_pricing_rules(args, pricing_rules) if pricing_rule: