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:
imacat committed 2020-08-02 14:08:38 +08:00
1 parent 7acef78d5d
commit a78cbb2ad8
1 file changed
+1
+1
View File
@@ -143,6 +143,7 @@ class Transaction(DirtyFieldsMixin, models.Model):
"""
if self._records is None:
self._records = list(self.record_set.all())
self._records.sort(key=lambda x: (x.is_credit, x.ord))
return self._records
@records.setter