diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 59bd637e41..a12f06bc96 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -1589,9 +1589,9 @@ def unlink_payment_on_cancel_of_invoice(enable=1): def enable_discount_accounting(enable=1): - accounts_settings = frappe.get_doc("Accounts Settings") - accounts_settings.enable_discount_accounting = enable - accounts_settings.save() + buying_settings = frappe.get_doc("Buying Settings") + buying_settings.enable_discount_accounting = enable + buying_settings.save() def make_purchase_invoice(**args): diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index caa70d00ef..eaab94108d 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -2685,9 +2685,6 @@ class TestSalesInvoice(unittest.TestCase): ) def test_sales_invoice_with_discount_accounting_enabled(self): - from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import ( - enable_discount_accounting, - ) enable_discount_accounting() @@ -2708,9 +2705,6 @@ class TestSalesInvoice(unittest.TestCase): enable_discount_accounting(enable=0) def test_additional_discount_for_sales_invoice_with_discount_accounting_enabled(self): - from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import ( - enable_discount_accounting, - ) enable_discount_accounting() additional_discount_account = create_account( @@ -3181,6 +3175,12 @@ class TestSalesInvoice(unittest.TestCase): ) +def enable_discount_accounting(enable=1): + selling_settings = frappe.get_doc("Selling Settings") + selling_settings.enable_discount_accounting = enable + selling_settings.save() + + def get_sales_invoice_for_e_invoice(): si = make_sales_invoice_for_ewaybill() si.naming_series = "INV-2020-.#####"