From 067afdb1652a88c67fbe4dd1e4cf59d3a6af2ec7 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:28:46 +0800 Subject: [PATCH] Fixed and moved the account_text pseudo property from the RecurringExpenseForm form to its base RecurringItemForm form. --- src/accounting/option/forms.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/accounting/option/forms.py b/src/accounting/option/forms.py index 07ab218..8bdfe83 100644 --- a/src/accounting/option/forms.py +++ b/src/accounting/option/forms.py @@ -108,6 +108,17 @@ class RecurringItemForm(FlaskForm): description_template = StringField() """The description template.""" + @property + def account_text(self) -> str | None: + """Returns the account text. + + :return: The account text. + """ + if self.account_code.data is None: + return None + account: Account | None = Account.find_by_code(self.account_code.data) + return None if account is None else str(account) + class RecurringExpenseForm(RecurringItemForm): """The sub-form to add or update the recurring expenses.""" @@ -130,17 +141,6 @@ class RecurringExpenseForm(RecurringItemForm): "Please fill in the description template."))]) """The template for the line item description.""" - @property - def account_text(self) -> str | None: - """Returns the account text. - - :return: The account text. - """ - if self.account_code.data is None: - return None - account: Account | None = Account.find_by_code(self.account_code.data) - return None if account is None else str(account) - class RecurringIncomeForm(RecurringItemForm): """The sub-form to add or update the recurring incomes."""