Revised the way to query accounts with Flask-SQLAlchemy style queries in the accounts method of the CurrentAccount data model.
This commit is contained in:
parent
0b1dd4f4fc
commit
433110f486
@ -21,7 +21,6 @@ from typing import Self
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from accounting import db
|
||||
from accounting.locale import gettext
|
||||
from accounting.models import Account
|
||||
|
||||
@ -75,7 +74,7 @@ class CurrentAccount:
|
||||
"""
|
||||
accounts: list[cls] = [cls.current_assets_and_liabilities()]
|
||||
accounts.extend([CurrentAccount(x)
|
||||
for x in db.session.query(Account)
|
||||
for x in Account.query
|
||||
.filter(cls.sql_condition())
|
||||
.order_by(Account.base_code, Account.no)])
|
||||
return accounts
|
||||
|
Loading…
Reference in New Issue
Block a user