Allow sorting by purchase price (unit price)

This commit is contained in:
Oliver 2021-08-26 07:50:19 +10:00
parent 4b8ef2ad62
commit 8660f13ef5
2 changed files with 4 additions and 4 deletions

View File

@ -239,12 +239,13 @@ class POLineItemList(generics.ListCreateAPIView):
} }
ordering_fields = [ ordering_fields = [
'part_name',
'MPN', 'MPN',
'SKU', 'part_name',
'reference', 'purchase_price',
'quantity', 'quantity',
'received', 'received',
'reference',
'SKU',
] ]
search_fields = [ search_fields = [

View File

@ -358,7 +358,6 @@ $("#po-table").inventreeTable({
{ {
sortable: true, sortable: true,
field: 'purchase_price', field: 'purchase_price',
sortName: 'price',
title: '{% trans "Unit Price" %}', title: '{% trans "Unit Price" %}',
formatter: function(value, row) { formatter: function(value, row) {
return row.purchase_price_string || row.purchase_price; return row.purchase_price_string || row.purchase_price;