From 3f0a0b4227a64a020fb06f04331959808de24521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 28 Nov 2023 08:26:37 +0800 Subject: [PATCH] Fixed the form validator to enable the selection of Accumulated Profit or Loss accounts other than 3351-001. --- src/accounting/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/accounting/forms.py b/src/accounting/forms.py index 64e8d9e..7415c79 100644 --- a/src/accounting/forms.py +++ b/src/accounting/forms.py @@ -71,7 +71,7 @@ class IsDebitAccount: if field.data is None: return if re.match(r"^(?:[1235689]|7[5678])", field.data) \ - and not field.data.startswith("3351-") \ + and field.data != "3351-001" \ and not field.data.startswith("3353-"): return raise ValidationError(self.__message) @@ -92,7 +92,7 @@ class IsCreditAccount: if field.data is None: return if re.match(r"^(?:[123489]|7[1234])", field.data) \ - and not field.data.startswith("3351-") \ + and field.data != "3351-001" \ and not field.data.startswith("3353-"): return raise ValidationError(self.__message)