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