2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-06 05:30:56 +00:00

Add a "sales_order" reference to the Build model

- If a build order is made to fulfil a sales order
- Add sales_order filtering to the Build API
- Pass initial information through to the BuildCreate view
This commit is contained in:
Oliver Walters
2020-04-25 13:15:45 +10:00
parent b351976ae9
commit d5f3498238
8 changed files with 96 additions and 29 deletions

View File

@ -38,6 +38,8 @@ class BuildList(generics.ListCreateAPIView):
]
filter_fields = [
'part',
'sales_order',
]
def get_queryset(self):
@ -48,12 +50,6 @@ class BuildList(generics.ListCreateAPIView):
build_list = super().get_queryset()
# Filter by part
part = self.request.query_params.get('part', None)
if part is not None:
build_list = build_list.filter(part=part)
# Filter by build status?
status = self.request.query_params.get('status', None)