diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 1030a32f161..16fc4b0d7d2 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -836,7 +836,7 @@ class TestSalesInvoice(FrappeTestCase): w = self.make() self.assertEqual(w.outstanding_amount, w.base_rounded_total) - @IntegrationTestCase.change_settings( + @change_settings( "Accounts Settings", {"add_taxes_from_item_tax_template": 0, "add_taxes_from_taxes_and_charges_template": 0}, ) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 2885490b31f..b6b7ff890cf 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1134,12 +1134,6 @@ class AccountsController(TransactionBase): return True def set_taxes_and_charges(self): -<<<<<<< HEAD - if frappe.db.get_single_value("Accounts Settings", "add_taxes_from_item_tax_template"): - if hasattr(self, "taxes_and_charges") and not self.get("taxes") and not self.get("is_pos"): - if tax_master_doctype := self.meta.get_field("taxes_and_charges").options: - self.append_taxes_from_master(tax_master_doctype) -======= if self.get("taxes") or self.get("is_pos"): return @@ -1151,7 +1145,6 @@ class AccountsController(TransactionBase): if frappe.get_single_value("Accounts Settings", "add_taxes_from_item_tax_template"): self.append_taxes_from_item_tax_template() ->>>>>>> 4cb1fa2b6b (fix: auto append_taxes_from_item_tax_template in backend) def append_taxes_from_master(self, tax_master_doctype=None): if self.get("taxes_and_charges"): @@ -1183,12 +1176,9 @@ class AccountsController(TransactionBase): "account_head": account_head, "rate": 0, "description": account_head, -<<<<<<< HEAD -======= "set_by_item_tax_template": 1, "category": "Total", "add_deduct_tax": "Add", ->>>>>>> 4cb1fa2b6b (fix: auto append_taxes_from_item_tax_template in backend) }, ) diff --git a/erpnext/controllers/tests/test_accounts_controller.py b/erpnext/controllers/tests/test_accounts_controller.py index b3b7427d32f..f2558572dc9 100644 --- a/erpnext/controllers/tests/test_accounts_controller.py +++ b/erpnext/controllers/tests/test_accounts_controller.py @@ -931,14 +931,10 @@ class TestAccountsController(FrappeTestCase): self.assertEqual(exc_je_for_si, []) self.assertEqual(exc_je_for_pe, []) -<<<<<<< HEAD - @change_settings("Accounts Settings", {"add_taxes_from_item_tax_template": 1}) -======= - @IntegrationTestCase.change_settings( + @change_settings( "Accounts Settings", {"add_taxes_from_item_tax_template": 0, "add_taxes_from_taxes_and_charges_template": 1}, ) ->>>>>>> 4cb1fa2b6b (fix: auto append_taxes_from_item_tax_template in backend) def test_18_fetch_taxes_based_on_taxes_and_charges_template(self): # Create a Sales Taxes and Charges Template if not frappe.db.exists("Sales Taxes and Charges Template", "_Test Tax - _TC"): @@ -967,7 +963,7 @@ class TestAccountsController(FrappeTestCase): self.assertEqual(sinv.total_taxes_and_charges, 4.5) - @IntegrationTestCase.change_settings( + @change_settings( "Accounts Settings", {"add_taxes_from_item_tax_template": 1, "add_taxes_from_taxes_and_charges_template": 0}, ) diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 98a2ae04c67..210f4715815 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -179,7 +179,7 @@ class TestQuotation(FrappeTestCase): sales_order.delivery_date = nowdate() sales_order.insert() - @IntegrationTestCase.change_settings( + @change_settings( "Accounts Settings", {"add_taxes_from_item_tax_template": 0, "add_taxes_from_taxes_and_charges_template": 0}, ) @@ -720,7 +720,7 @@ class TestQuotation(FrappeTestCase): quotation.items[0].conversion_factor = 2.23 self.assertRaises(frappe.ValidationError, quotation.save) - @IntegrationTestCase.change_settings( + @change_settings( "Accounts Settings", {"add_taxes_from_item_tax_template": 1, "add_taxes_from_taxes_and_charges_template": 0}, )