mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix filtering for build orders
This commit is contained in:
parent
2295008944
commit
a0b3359d62
@ -68,10 +68,6 @@ class BuildList(generics.ListCreateAPIView):
|
|||||||
filters.OrderingFilter,
|
filters.OrderingFilter,
|
||||||
]
|
]
|
||||||
|
|
||||||
filter_fields = [
|
|
||||||
'sales_order',
|
|
||||||
]
|
|
||||||
|
|
||||||
ordering_fields = [
|
ordering_fields = [
|
||||||
'reference',
|
'reference',
|
||||||
'part__name',
|
'part__name',
|
||||||
@ -114,6 +110,12 @@ class BuildList(generics.ListCreateAPIView):
|
|||||||
if parent is not None:
|
if parent is not None:
|
||||||
queryset = queryset.filter(parent=parent)
|
queryset = queryset.filter(parent=parent)
|
||||||
|
|
||||||
|
# Filter by sales_order
|
||||||
|
sales_order = params.get('sales_order', None)
|
||||||
|
|
||||||
|
if sales_order is not None:
|
||||||
|
queryset = queryset.filter(sales_order=sales_order)
|
||||||
|
|
||||||
# Filter by "ancestor" builds
|
# Filter by "ancestor" builds
|
||||||
ancestor = params.get('ancestor', None)
|
ancestor = params.get('ancestor', None)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user