From 89e43830b45738bf243ee86bf2ecc291721221a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Wed, 22 Mar 2023 19:17:25 +0800 Subject: [PATCH] Fixed the __get_accounts method of the DescriptionEditor class not to do empty queries. --- src/accounting/journal_entry/utils/description_editor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/accounting/journal_entry/utils/description_editor.py b/src/accounting/journal_entry/utils/description_editor.py index b6c6792..a429652 100644 --- a/src/accounting/journal_entry/utils/description_editor.py +++ b/src/accounting/journal_entry/utils/description_editor.py @@ -300,6 +300,9 @@ class DescriptionEditor: :param codes: The account codes. :return: The account. """ + if len(codes) == 0: + return {} + def get_condition(code0: str) -> sa.BinaryExpression: m: re.Match = re.match(r"^(\d{4})-(\d{3})$", code0) assert m is not None,\