add po API endpoints

This commit is contained in:
Matthias 2022-03-11 00:09:07 +01:00
parent c30e8d9b4e
commit 2036164ef1
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -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<pk>\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([