From 951092eecd269ba90aa1836e1083a1d3f1087135 Mon Sep 17 00:00:00 2001 From: tunde Date: Thu, 21 Sep 2017 11:14:53 +0100 Subject: [PATCH] fix sales order and pricing rule failing tests --- erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py | 2 ++ erpnext/selling/doctype/sales_order/test_sales_order.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index 9ec69c32c7..3fa34e279a 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -256,6 +256,7 @@ class TestPricingRule(unittest.TestCase): make_pricing_rule(selling=1, margin_type="Percentage", margin_rate_or_amount=10) si = create_sales_invoice(do_not_save=True) si.items[0].price_list_rate = 1000 + si.payment_schedule = [] si.insert(ignore_permissions=True) item = si.items[0] @@ -264,6 +265,7 @@ class TestPricingRule(unittest.TestCase): # With discount item.discount_percentage = 10 + si.payment_schedule = [] si.save() item = si.items[0] self.assertEquals(item.rate, 990) diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 972453cace..8f3b14a199 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -526,6 +526,8 @@ class TestSalesOrder(unittest.TestCase): self.assertEquals(new_so.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate)) new_so.items[0].margin_rate_or_amount = 25 + new_so.payment_schedule = [] + new_so.save() new_so.submit() self.assertEquals(new_so.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate)) @@ -564,6 +566,10 @@ def make_sales_order(**args): so.insert() if not args.do_not_submit: so.submit() + else: + so.payment_schedule = [] + else: + so.payment_schedule = [] return so