From 2036164ef196b6db680c9951feda2d30c3471a7e Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 11 Mar 2022 00:09:07 +0100 Subject: [PATCH] add po API endpoints --- InvenTree/order/api.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/InvenTree/order/api.py b/InvenTree/order/api.py index 063939a4a7..92a5263141 100644 --- a/InvenTree/order/api.py +++ b/InvenTree/order/api.py @@ -501,6 +501,22 @@ class POLineItemDetail(generics.RetrieveUpdateDestroyAPIView): return queryset +class POAdditionalLineItemList(GeneralAdditionalLineItemList, generics.ListCreateAPIView): + """ + API endpoint for accessing a list of PurchaseOrderAdditionalLineItem objects. + """ + + queryset = models.PurchaseOrderAdditionalLineItem.objects.all() + serializer_class = serializers.POAdditionalLineItemSerializer + + +class POAdditionalLineItemDetail(generics.RetrieveUpdateDestroyAPIView): + """ API endpoint for detail view of a PurchaseOrderAdditionalLineItem object """ + + queryset = models.PurchaseOrderAdditionalLineItem.objects.all() + serializer_class = serializers.POAdditionalLineItemSerializer + + class SOAttachmentList(generics.ListCreateAPIView, AttachmentMixin): """ API endpoint for listing (and creating) a SalesOrderAttachment (file upload) @@ -1096,6 +1112,12 @@ order_api_urls = [ url(r'^.*$', POLineItemList.as_view(), name='api-po-line-list'), ])), + # API endpoints for purchase order additional line items + url(r'^po-additional-line/', include([ + url(r'^(?P\d+)/$', POAdditionalLineItemDetail.as_view(), name='api-po-additional-line-detail'), + url(r'^$', POAdditionalLineItemList.as_view(), name='api-po-additional-line-list'), + ])), + # API endpoints for sales ordesr url(r'^so/', include([ url(r'attachment/', include([