mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Adds "stock" column sorting for stock table
This commit is contained in:
parent
ab32ab0b3b
commit
85b906f49d
@ -876,6 +876,7 @@ class StockList(generics.ListCreateAPIView):
|
|||||||
|
|
||||||
ordering_field_aliases = {
|
ordering_field_aliases = {
|
||||||
'SKU': 'supplier_part__SKU',
|
'SKU': 'supplier_part__SKU',
|
||||||
|
'stock': ['quantity', 'serial'],
|
||||||
}
|
}
|
||||||
|
|
||||||
ordering_fields = [
|
ordering_fields = [
|
||||||
@ -887,6 +888,7 @@ class StockList(generics.ListCreateAPIView):
|
|||||||
'stocktake_date',
|
'stocktake_date',
|
||||||
'expiry_date',
|
'expiry_date',
|
||||||
'quantity',
|
'quantity',
|
||||||
|
'stock',
|
||||||
'status',
|
'status',
|
||||||
'SKU',
|
'SKU',
|
||||||
]
|
]
|
||||||
|
@ -1128,7 +1128,9 @@ function loadStockTable(table, options) {
|
|||||||
|
|
||||||
col = {
|
col = {
|
||||||
field: 'quantity',
|
field: 'quantity',
|
||||||
|
sortName: 'stock',
|
||||||
title: '{% trans "Stock" %}',
|
title: '{% trans "Stock" %}',
|
||||||
|
sortable: true,
|
||||||
formatter: function(value, row) {
|
formatter: function(value, row) {
|
||||||
|
|
||||||
var val = parseFloat(value);
|
var val = parseFloat(value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user