From 8660f13ef5b49c27b98213f763875364d2553e25 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 26 Aug 2021 07:50:19 +1000 Subject: [PATCH] Allow sorting by purchase price (unit price) --- InvenTree/order/api.py | 7 ++++--- InvenTree/order/templates/order/purchase_order_detail.html | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/InvenTree/order/api.py b/InvenTree/order/api.py index e728b19226..cb33b3f680 100644 --- a/InvenTree/order/api.py +++ b/InvenTree/order/api.py @@ -239,12 +239,13 @@ class POLineItemList(generics.ListCreateAPIView): } ordering_fields = [ - 'part_name', 'MPN', - 'SKU', - 'reference', + 'part_name', + 'purchase_price', 'quantity', 'received', + 'reference', + 'SKU', ] search_fields = [ diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index 52355f1266..2048599825 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -358,7 +358,6 @@ $("#po-table").inventreeTable({ { sortable: true, field: 'purchase_price', - sortName: 'price', title: '{% trans "Unit Price" %}', formatter: function(value, row) { return row.purchase_price_string || row.purchase_price;