fix: Create Item tax template only for specific account types

This commit is contained in:
Deepesh Garg 2020-03-13 11:51:14 +05:30
parent 74d4e9e4ea
commit 0b7acc0fd6

View File

@ -118,7 +118,9 @@ def get_item_tax_template(item_tax_templates, item_tax_map, item_code, parenttyp
account.insert()
tax_type = account.name
if tax_type:
account_type = frappe.get_cached_value("Account", tax_type, "account_type")
if tax_type and account_type in ('Tax', 'Chargeable', 'Income Account', 'Expense Account', 'Expenses Included In Valuation'):
item_tax_template.append("taxes", {"tax_type": tax_type, "tax_rate": tax_rate})
item_tax_templates.setdefault(item_tax_template.title, {})
item_tax_templates[item_tax_template.title][tax_type] = tax_rate