From 46f19449590ff9828ecf9be5192fd2a58b9b02cf Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Thu, 2 Nov 2023 12:44:53 +0530 Subject: [PATCH] chore: 1-99 validations for loan partner percentages --- .../loan_management/doctype/loan_partner/loan_partner.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lending/loan_management/doctype/loan_partner/loan_partner.py b/lending/loan_management/doctype/loan_partner/loan_partner.py index 649fa461..440450ad 100644 --- a/lending/loan_management/doctype/loan_partner/loan_partner.py +++ b/lending/loan_management/doctype/loan_partner/loan_partner.py @@ -27,8 +27,8 @@ def validate_percentage_and_interest_fields(self): ] for field in fields: - if self.get(field) and (self.get(field) < 0 or self.get(field) > 100): - frappe.throw(_("{0} should be between 0 and 100").format(frappe.bold(frappe.unscrub(field)))) + if self.get(field) and (self.get(field) < 1 or self.get(field) > 99): + frappe.throw(_("{0} should be between 1 and 99").format(frappe.bold(frappe.unscrub(field)))) shareables_fields = [ "partner_collection_percentage", @@ -39,9 +39,9 @@ def validate_percentage_and_interest_fields(self): for shareable in self.shareables: for field in shareables_fields: - if shareable.get(field) and (shareable.get(field) < 0 or shareable.get(field) > 100): + if shareable.get(field) and (shareable.get(field) < 1 or shareable.get(field) > 99): frappe.throw( - _("Row {0}: {1} should be between 0 and 100").format( + _("Row {0}: {1} should be between 1 and 99").format( shareable.idx, frappe.bold(frappe.unscrub(field)) ) )