mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 11:39:18 +00:00
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:
@@ -39,7 +39,16 @@ class ItemTaxTemplate(Document):
|
|||||||
check_list = []
|
check_list = []
|
||||||
for d in self.get("taxes"):
|
for d in self.get("taxes"):
|
||||||
if d.tax_type:
|
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 [
|
if account_type not in [
|
||||||
"Tax",
|
"Tax",
|
||||||
|
|||||||
Reference in New Issue
Block a user