Fix default ordering for build orders (#3626)

- Order by reference
- Show "newer" references first
This commit is contained in:
Oliver 2022-09-01 12:25:08 +10:00 committed by GitHub
parent 7f5f101323
commit 0150afd7a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -100,6 +100,8 @@ class BuildList(APIDownloadMixin, ListCreateAPI):
'reference': ['reference_int', 'reference'], 'reference': ['reference_int', 'reference'],
} }
ordering = '-reference'
search_fields = [ search_fields = [
'reference', 'reference',
'title', 'title',

View File

@ -292,7 +292,7 @@ class PurchaseOrderList(APIDownloadMixin, ListCreateAPI):
'status', 'status',
] ]
ordering = '-creation_date' ordering = '-reference'
class PurchaseOrderDetail(RetrieveUpdateDestroyAPI): class PurchaseOrderDetail(RetrieveUpdateDestroyAPI):
@ -733,7 +733,7 @@ class SalesOrderList(APIDownloadMixin, ListCreateAPI):
'customer_reference', 'customer_reference',
] ]
ordering = '-creation_date' ordering = '-reference'
class SalesOrderDetail(RetrieveUpdateDestroyAPI): class SalesOrderDetail(RetrieveUpdateDestroyAPI):