From e7962672148602d707377e0c44a18dbcdea00922 Mon Sep 17 00:00:00 2001 From: Sherin KR Date: Mon, 4 Apr 2022 06:37:51 -0700 Subject: [PATCH] fix: Validation for single threshold in Tax With Holding Category (#30382) (cherry picked from commit 0a2c72c594963f63551985a908c1c79302556e91) --- .../tax_withholding_category/tax_withholding_category.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py index 35c2f8494f..a519d8be73 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -34,7 +34,9 @@ class TaxWithholdingCategory(Document): def validate_thresholds(self): for d in self.get("rates"): - if d.cumulative_threshold and d.cumulative_threshold < d.single_threshold: + if ( + d.cumulative_threshold and d.single_threshold and d.cumulative_threshold < d.single_threshold + ): frappe.throw( _("Row #{0}: Cumulative threshold cannot be less than Single Transaction threshold").format( d.idx