diff --git a/accountant/models/accounts.py b/accountant/models/accounts.py index d5924d5..2ba40c9 100644 --- a/accountant/models/accounts.py +++ b/accountant/models/accounts.py @@ -195,7 +195,7 @@ class Account(db.Model): ) if end: - query = query.filter(query.c.operation_date <= str(end)) + query = query.filter(base_query.c.operation_date <= str(end)) elif end: query = query.filter(Operation.operation_date <= str(end))