Fixed the records pseudo property of the Transaction data model to find the records only for existing transactions, to work with Django 4.1.
This commit is contained in:
parent
86b84bef7a
commit
4afd072cc5
@ -303,8 +303,11 @@ class Transaction(DirtyFieldsMixin, StampedModel, RandomPkModel):
|
||||
List[Record]: The records.
|
||||
"""
|
||||
if self._records is None:
|
||||
self._records = list(self.record_set.all())
|
||||
self._records.sort(key=lambda x: (x.is_credit, x.ord))
|
||||
if self.pk is None:
|
||||
self._records = []
|
||||
else:
|
||||
self._records = list(self.record_set.all())
|
||||
self._records.sort(key=lambda x: (x.is_credit, x.ord))
|
||||
return self._records
|
||||
|
||||
@records.setter
|
||||
|
Loading…
x
Reference in New Issue
Block a user