From 47a8670d378e7fb72bf2356aba574e256243d74b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 28 May 2014 17:03:28 +0530 Subject: [PATCH] pricing rule testcase fixes --- erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py | 2 +- erpnext/stock/get_item_details.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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: