mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-03 13:58:47 +00:00
Improve server-side pagination of SalesOrderLineItem
This commit is contained in:
parent
4ff1c690cc
commit
1c3b017283
@ -412,7 +412,23 @@ class SOLineItemList(generics.ListCreateAPIView):
|
|||||||
|
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
filter_backends = [DjangoFilterBackend]
|
filter_backends = [
|
||||||
|
DjangoFilterBackend,
|
||||||
|
filters.SearchFilter,
|
||||||
|
filters.OrderingFilter
|
||||||
|
]
|
||||||
|
|
||||||
|
ordering_fields = [
|
||||||
|
'part__name',
|
||||||
|
'quantity',
|
||||||
|
'reference',
|
||||||
|
]
|
||||||
|
|
||||||
|
search_fields = [
|
||||||
|
'part__name',
|
||||||
|
'quantity',
|
||||||
|
'reference',
|
||||||
|
]
|
||||||
|
|
||||||
filter_fields = [
|
filter_fields = [
|
||||||
'order',
|
'order',
|
||||||
|
@ -173,6 +173,7 @@ $("#so-lines-table").inventreeTable({
|
|||||||
part_detail: true,
|
part_detail: true,
|
||||||
allocations: true,
|
allocations: true,
|
||||||
},
|
},
|
||||||
|
sidePagination: 'server',
|
||||||
uniqueId: 'pk',
|
uniqueId: 'pk',
|
||||||
url: "{% url 'api-so-line-list' %}",
|
url: "{% url 'api-so-line-list' %}",
|
||||||
onPostBody: setupCallbacks,
|
onPostBody: setupCallbacks,
|
||||||
@ -201,6 +202,7 @@ $("#so-lines-table").inventreeTable({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
sortName: 'part__name',
|
||||||
field: 'part',
|
field: 'part',
|
||||||
title: 'Part',
|
title: 'Part',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
@ -222,7 +224,6 @@ $("#so-lines-table").inventreeTable({
|
|||||||
title: 'Quantity',
|
title: 'Quantity',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
|
||||||
field: 'allocated',
|
field: 'allocated',
|
||||||
{% if order.status == SalesOrderStatus.PENDING %}
|
{% if order.status == SalesOrderStatus.PENDING %}
|
||||||
title: '{% trans "Allocated" %}',
|
title: '{% trans "Allocated" %}',
|
||||||
|
@ -853,7 +853,9 @@ class StockList(generics.ListCreateAPIView):
|
|||||||
'status',
|
'status',
|
||||||
]
|
]
|
||||||
|
|
||||||
ordering = ['part__name']
|
ordering = [
|
||||||
|
'part__name'
|
||||||
|
]
|
||||||
|
|
||||||
search_fields = [
|
search_fields = [
|
||||||
'serial',
|
'serial',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user