Renamed IncomeExpensesAccount to CurrentAccount.
This commit is contained in:
@ -28,7 +28,7 @@ from wtforms.validators import DataRequired, ValidationError
|
||||
from accounting.forms import CURRENCY_REQUIRED, CurrencyExists
|
||||
from accounting.locale import lazy_gettext
|
||||
from accounting.models import Account
|
||||
from accounting.utils.ie_account import IncomeExpensesAccount, ie_accounts
|
||||
from accounting.utils.current_account import CurrentAccount, current_accounts
|
||||
from accounting.utils.strip_text import strip_text
|
||||
from .options import Options
|
||||
|
||||
@ -242,9 +242,9 @@ class OptionForm(FlaskForm):
|
||||
obj.recurring_data = self.recurring.form.as_data
|
||||
|
||||
@property
|
||||
def ie_accounts(self) -> list[IncomeExpensesAccount]:
|
||||
"""Returns the accounts for the income and expenses log.
|
||||
def current_accounts(self) -> list[CurrentAccount]:
|
||||
"""Returns the current accounts.
|
||||
|
||||
:return: The accounts for the income and expenses log.
|
||||
:return: The current accounts.
|
||||
"""
|
||||
return ie_accounts()
|
||||
return current_accounts()
|
||||
|
@ -23,7 +23,7 @@ import sqlalchemy as sa
|
||||
|
||||
from accounting import db
|
||||
from accounting.models import Option, Account
|
||||
from accounting.utils.ie_account import IncomeExpensesAccount
|
||||
from accounting.utils.current_account import CurrentAccount
|
||||
from accounting.utils.user import get_current_user_pk
|
||||
|
||||
|
||||
@ -108,15 +108,15 @@ class Options:
|
||||
self.__set_option("default_ie_account", value)
|
||||
|
||||
@property
|
||||
def default_ie_account(self) -> IncomeExpensesAccount:
|
||||
def default_ie_account(self) -> CurrentAccount:
|
||||
"""Returns the default account code for the income and expenses log.
|
||||
|
||||
:return: The default account code for the income and expenses log.
|
||||
"""
|
||||
if self.default_ie_account_code \
|
||||
== IncomeExpensesAccount.CURRENT_AL_CODE:
|
||||
return IncomeExpensesAccount.current_assets_and_liabilities()
|
||||
return IncomeExpensesAccount(
|
||||
== CurrentAccount.CURRENT_AL_CODE:
|
||||
return CurrentAccount.current_assets_and_liabilities()
|
||||
return CurrentAccount(
|
||||
Account.find_by_code(self.default_ie_account_code))
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user