fix: company validation for accounts on item tax template (#47964)

* fix: company validation for accounts on item tax template

* fix: syntax error
This commit is contained in:
Diptanil Saha
2025-06-13 12:38:04 +05:30
committed by GitHub
parent 41509d37af
commit f37d5f188e

View File

@@ -39,7 +39,16 @@ class ItemTaxTemplate(Document):
check_list = []
for d in self.get("taxes"):
if d.tax_type:
account_type = frappe.get_cached_value("Account", d.tax_type, "account_type")
account_type, account_company = frappe.get_cached_value(
"Account", d.tax_type, ["account_type", "company"]
)
if account_company != self.company:
frappe.throw(
_("Item Tax Row {0}: Account must belong to Company - {1}").format(
d.idx, frappe.bold(self.company)
)
)
if account_type not in [
"Tax",