diff --git a/InvenTree/build/api.py b/InvenTree/build/api.py index cb6b3f6b2b..175f39ba63 100644 --- a/InvenTree/build/api.py +++ b/InvenTree/build/api.py @@ -38,6 +38,22 @@ class BuildList(generics.ListCreateAPIView): 'sales_order', ] + ordering_fields = [ + 'reference', + 'part__name', + 'status', + 'creation_date', + 'target_date', + 'completion_date', + 'quantity', + ] + + search_fields = [ + 'reference', + 'part__name', + 'description', + ] + def get_queryset(self): """ Override the queryset filtering, diff --git a/InvenTree/templates/js/build.js b/InvenTree/templates/js/build.js index 45ebd133d1..daa78748a4 100644 --- a/InvenTree/templates/js/build.js +++ b/InvenTree/templates/js/build.js @@ -671,12 +671,12 @@ function loadBuildTable(table, options) { { field: 'title', title: '{% trans "Description" %}', - sortable: true, }, { field: 'part', title: '{% trans "Part" %}', sortable: true, + sortName: 'part__name', formatter: function(value, row, index, field) { var html = imageHoverIcon(row.part_detail.thumbnail); diff --git a/InvenTree/templates/js/company.js b/InvenTree/templates/js/company.js index b497609db1..601d4a5370 100644 --- a/InvenTree/templates/js/company.js +++ b/InvenTree/templates/js/company.js @@ -54,7 +54,6 @@ function loadCompanyTable(table, url, options={}) { { field: 'description', title: '{% trans "Description" %}', - sortable: true, }, { field: 'website',