Closed sinavir closed 3 months ago
diff --git a/django_ledger/views/account.py b/django_ledger/views/account.py
index 4655250..679f061 100644
--- a/django_ledger/views/account.py
+++ b/django_ledger/views/account.py
@@ -210,7 +210,7 @@ class AccountModelYearDetailView(DjangoLedgerSecurityMixIn,
context['header_title'] = f'Account {account.code} - {account.name}'
context['page_title'] = f'Account {account.code} - {account.name}'
account_model: AccountModel = self.object
- txs_qs = account_model.transactionmodel_set.posted().order_by(
+ txs_qs = account_model.transactionmodel_set(manager="objects").all().posted().order_by(
'journal_entry__timestamp').select_related(
'journal_entry', 'journal_entry__entity_unit')
txs_qs = txs_qs.from_date(self.get_from_date())
This is a quick and dirty fix. A best way would be to dig into the QuerySet/Manager logic but I'm not very used to this part of django framework
Got the same error i think the error 'RelatedManager' object has no attribute 'posted' is occurring when you try to call the method posted() directly on a related manager that is transactionmodel_set without first accessing a queryset instance.
i have opened a pull request for this https://github.com/arrobalytics/django-ledger/pull/213#issue-2402980383
@25-do @sinavir Thanks for reporting this issue... I'll be addressing this on the next version
Issue resolved by #214
Describe the bug Account detail view is not working with the following error:
To Reproduce Steps to reproduce the behavior:
Expected behavior
Working view
Additional context
I use the python packages from my distro (NixOS). This may be the issue can you give me information on whether you achieve to reproduce the bug ?