Fix server-side ordering for purchase order table

This commit is contained in:
Oliver Walters 2021-03-03 08:13:55 +11:00
parent a53aadd466
commit 0b15b77140
2 changed files with 5 additions and 2 deletions

View File

@ -140,6 +140,10 @@ class POList(generics.ListCreateAPIView):
ordering_fields = [
'creation_date',
'reference',
'supplier__name',
'target_date',
'line_items',
'status',
]
ordering = '-creation_date'

View File

@ -167,6 +167,7 @@ function loadPurchaseOrderTable(table, options) {
field: 'supplier_detail',
title: '{% trans "Supplier" %}',
sortable: true,
sortName: 'supplier__name',
formatter: function(value, row, index, field) {
return imageHoverIcon(row.supplier_detail.image) + renderLink(row.supplier_detail.name, `/company/${row.supplier}/purchase-orders/`);
}
@ -174,12 +175,10 @@ function loadPurchaseOrderTable(table, options) {
{
field: 'supplier_reference',
title: '{% trans "Supplier Reference" %}',
sortable: true,
},
{
field: 'description',
title: '{% trans "Description" %}',
sortable: true,
},
{
field: 'status',