Merge pull request #36689 from frappe/mergify/bp/version-14-hotfix/pr-36685

fix: check tax and charges if it is passed (backport #36685)
This commit is contained in:
Shariq Ansari
2023-08-17 13:10:42 +05:30
committed by GitHub

View File

@@ -715,7 +715,9 @@ class AccountsController(TransactionBase):
def validate_enabled_taxes_and_charges(self):
taxes_and_charges_doctype = self.meta.get_options("taxes_and_charges")
if frappe.get_cached_value(taxes_and_charges_doctype, self.taxes_and_charges, "disabled"):
if self.taxes_and_charges and frappe.get_cached_value(
taxes_and_charges_doctype, self.taxes_and_charges, "disabled"
):
frappe.throw(
_("{0} '{1}' is disabled").format(taxes_and_charges_doctype, self.taxes_and_charges)
)