Update sorting

This commit is contained in:
Edgar P. Burkhart 2023-01-01 10:17:06 +01:00
parent 4c34716992
commit 39b620135a
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -75,7 +75,7 @@ class Account(CustomModel):
return Snapshot.objects.filter(account=self) return Snapshot.objects.filter(account=self)
class Meta: class Meta:
ordering = ["name"] ordering = ["-default", "name"]
verbose_name = _("Account") verbose_name = _("Account")
verbose_name_plural = _("Accounts") verbose_name_plural = _("Accounts")
@ -197,7 +197,7 @@ class Snapshot(AccountModel):
return reverse("del_snapshot", kwargs={"pk": self.pk}) return reverse("del_snapshot", kwargs={"pk": self.pk})
class Meta: class Meta:
ordering = ["-date"] ordering = ["-date", "account"]
verbose_name = _("Statement") verbose_name = _("Statement")
verbose_name_plural = _("Statements") verbose_name_plural = _("Statements")
@ -267,7 +267,7 @@ class Transaction(CustomModel):
return self.invoices.count() > 0 return self.invoices.count() > 0
class Meta: class Meta:
ordering = ["-date"] ordering = ["-date", "snapshot"]
verbose_name = _("Transaction") verbose_name = _("Transaction")
verbose_name_plural = _("Transactions") verbose_name_plural = _("Transactions")
@ -316,3 +316,4 @@ class Invoice(CustomModel):
class Meta: class Meta:
verbose_name = _("Invoice") verbose_name = _("Invoice")
verbose_name_plural = _("Invoices") verbose_name_plural = _("Invoices")
ordering = ["transaction", "name"]