mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Improve server-side pagination for POLineItem
This commit is contained in:
parent
1c3b017283
commit
6f4178acdb
@ -200,6 +200,22 @@ class POLineItemList(generics.ListCreateAPIView):
|
||||
|
||||
filter_backends = [
|
||||
DjangoFilterBackend,
|
||||
filters.SearchFilter,
|
||||
filters.OrderingFilter
|
||||
]
|
||||
|
||||
ordering_fields = [
|
||||
'part__part__name',
|
||||
'part__MPN',
|
||||
'part__SKU',
|
||||
'reference',
|
||||
'quantity',
|
||||
'received',
|
||||
]
|
||||
|
||||
search_Fields = [
|
||||
'part__part__name',
|
||||
'part__part__description',
|
||||
]
|
||||
|
||||
filter_fields = [
|
||||
|
@ -135,6 +135,7 @@ function setupCallbacks() {
|
||||
$("#po-table").inventreeTable({
|
||||
onPostBody: setupCallbacks,
|
||||
name: 'purchaseorder',
|
||||
sidePagination: 'server',
|
||||
formatNoMatches: function() { return "{% trans 'No line items found' %}"; },
|
||||
queryParams: {
|
||||
order: {{ order.id }},
|
||||
@ -151,6 +152,7 @@ $("#po-table").inventreeTable({
|
||||
{
|
||||
field: 'part',
|
||||
sortable: true,
|
||||
sortName: 'part__part__name',
|
||||
title: '{% trans "Part" %}',
|
||||
switchable: false,
|
||||
formatter: function(value, row, index, field) {
|
||||
@ -162,18 +164,24 @@ $("#po-table").inventreeTable({
|
||||
},
|
||||
},
|
||||
{
|
||||
sortable: true,
|
||||
field: 'part_detail.description',
|
||||
title: '{% trans "Description" %}',
|
||||
},
|
||||
{
|
||||
sortable: true,
|
||||
sortName: 'part__SKU',
|
||||
field: 'supplier_part_detail.SKU',
|
||||
title: '{% trans "Order Code" %}',
|
||||
title: '{% trans "SKU" %}',
|
||||
formatter: function(value, row, index, field) {
|
||||
return renderLink(value, `/supplier-part/${row.part}/`);
|
||||
},
|
||||
},
|
||||
{
|
||||
sortable: true,
|
||||
sortName: 'part__MPN',
|
||||
field: 'supplier_part_detail.MPN',
|
||||
title: '{% trans "MPN" %}',
|
||||
},
|
||||
{
|
||||
sortable: true,
|
||||
field: 'reference',
|
||||
|
Loading…
Reference in New Issue
Block a user