fix: auto append_taxes_from_item_tax_template in backend

(cherry picked from commit 4cb1fa2b6b)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
#	erpnext/controllers/tests/test_accounts_controller.py
This commit is contained in:
ljain112
2025-06-12 11:57:30 +05:30
committed by Mergify
parent 6511eb4c7c
commit 2bf8dffb60
7 changed files with 100 additions and 3 deletions

View File

@@ -1134,10 +1134,24 @@ 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
if frappe.get_single_value(
"Accounts Settings", "add_taxes_from_taxes_and_charges_template"
) and hasattr(self, "taxes_and_charges"):
if tax_master_doctype := self.meta.get_field("taxes_and_charges").options:
self.append_taxes_from_master(tax_master_doctype)
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"):
@@ -1169,6 +1183,12 @@ 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)
},
)