Revised the records property of the record data model so that the returned records are sorted by their types and their orders in the accounting application.
This commit is contained in:
parent
7acef78d5d
commit
a78cbb2ad8
@ -143,6 +143,7 @@ class Transaction(DirtyFieldsMixin, models.Model):
|
|||||||
"""
|
"""
|
||||||
if self._records is None:
|
if self._records is None:
|
||||||
self._records = list(self.record_set.all())
|
self._records = list(self.record_set.all())
|
||||||
|
self._records.sort(key=lambda x: (x.is_credit, x.ord))
|
||||||
return self._records
|
return self._records
|
||||||
|
|
||||||
@records.setter
|
@records.setter
|
||||||
|
Loading…
Reference in New Issue
Block a user