From 0150afd7a7733fa2bd4ed411a0c66ef12b3ab6e4 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 1 Sep 2022 12:25:08 +1000 Subject: [PATCH] Fix default ordering for build orders (#3626) - Order by reference - Show "newer" references first --- InvenTree/build/api.py | 2 ++ InvenTree/order/api.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/InvenTree/build/api.py b/InvenTree/build/api.py index 3ef0b2b1c8..71b806314f 100644 --- a/InvenTree/build/api.py +++ b/InvenTree/build/api.py @@ -100,6 +100,8 @@ class BuildList(APIDownloadMixin, ListCreateAPI): 'reference': ['reference_int', 'reference'], } + ordering = '-reference' + search_fields = [ 'reference', 'title', diff --git a/InvenTree/order/api.py b/InvenTree/order/api.py index 0a625a89c3..e15aa0dcd0 100644 --- a/InvenTree/order/api.py +++ b/InvenTree/order/api.py @@ -292,7 +292,7 @@ class PurchaseOrderList(APIDownloadMixin, ListCreateAPI): 'status', ] - ordering = '-creation_date' + ordering = '-reference' class PurchaseOrderDetail(RetrieveUpdateDestroyAPI): @@ -733,7 +733,7 @@ class SalesOrderList(APIDownloadMixin, ListCreateAPI): 'customer_reference', ] - ordering = '-creation_date' + ordering = '-reference' class SalesOrderDetail(RetrieveUpdateDestroyAPI):