Adds "stock" column sorting for stock table

This commit is contained in:
Oliver 2021-11-10 09:48:52 +11:00
parent ab32ab0b3b
commit 85b906f49d
2 changed files with 4 additions and 0 deletions

View File

@ -876,6 +876,7 @@ class StockList(generics.ListCreateAPIView):
ordering_field_aliases = {
'SKU': 'supplier_part__SKU',
'stock': ['quantity', 'serial'],
}
ordering_fields = [
@ -887,6 +888,7 @@ class StockList(generics.ListCreateAPIView):
'stocktake_date',
'expiry_date',
'quantity',
'stock',
'status',
'SKU',
]

View File

@ -1128,7 +1128,9 @@ function loadStockTable(table, options) {
col = {
field: 'quantity',
sortName: 'stock',
title: '{% trans "Stock" %}',
sortable: true,
formatter: function(value, row) {
var val = parseFloat(value);