fix: auto append_taxes_from_item_tax_template in backend

This commit is contained in:
ljain112
2025-06-12 11:57:30 +05:30
committed by ruthra kumar
parent 5840645663
commit 4cb1fa2b6b
7 changed files with 89 additions and 7 deletions

View File

@@ -179,6 +179,10 @@ class TestQuotation(IntegrationTestCase):
sales_order.delivery_date = nowdate()
sales_order.insert()
@IntegrationTestCase.change_settings(
"Accounts Settings",
{"add_taxes_from_item_tax_template": 0, "add_taxes_from_taxes_and_charges_template": 0},
)
def test_make_sales_order_with_terms(self):
from erpnext.selling.doctype.quotation.quotation import make_sales_order
@@ -718,6 +722,10 @@ class TestQuotation(IntegrationTestCase):
quotation.items[0].conversion_factor = 2.23
self.assertRaises(frappe.ValidationError, quotation.save)
@IntegrationTestCase.change_settings(
"Accounts Settings",
{"add_taxes_from_item_tax_template": 1, "add_taxes_from_taxes_and_charges_template": 0},
)
def test_item_tax_template_for_quotation(self):
from erpnext.stock.doctype.item.test_item import make_item
@@ -759,10 +767,7 @@ class TestQuotation(IntegrationTestCase):
item_doc.save()
quotation = make_quotation(item_code="_Test Item Tax Template QTN", qty=1, rate=100, do_not_submit=1)
self.assertFalse(quotation.taxes)
quotation.append_taxes_from_item_tax_template()
quotation.save()
self.assertTrue(quotation.taxes)
for row in quotation.taxes:
self.assertEqual(row.account_head, "_Test Vat - _TC")