mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add API schema
This commit is contained in:
parent
3452880d2a
commit
de11b3463e
@ -798,6 +798,13 @@ class SOAdditionalLineItemList(generics.ListCreateAPIView):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class SOAdditionalLineItemDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||||
|
""" API endpoint for detail view of a SalesOrderAdditionalLineItem object """
|
||||||
|
|
||||||
|
queryset = models.SalesOrderAdditionalLineItem.objects.all()
|
||||||
|
serializer_class = serializers.SOAdditionalLineItemSerializer
|
||||||
|
|
||||||
|
|
||||||
class SOLineItemDetail(generics.RetrieveUpdateDestroyAPIView):
|
class SOLineItemDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||||
""" API endpoint for detail view of a SalesOrderLineItem object """
|
""" API endpoint for detail view of a SalesOrderLineItem object """
|
||||||
|
|
||||||
@ -1116,6 +1123,12 @@ order_api_urls = [
|
|||||||
url(r'^$', SOLineItemList.as_view(), name='api-so-line-list'),
|
url(r'^$', SOLineItemList.as_view(), name='api-so-line-list'),
|
||||||
])),
|
])),
|
||||||
|
|
||||||
|
# API endpoints for sales order additional line items
|
||||||
|
url(r'^so-additional-line/', include([
|
||||||
|
url(r'^(?P<pk>\d+)/$', SOAdditionalLineItemDetail.as_view(), name='api-so-additional-line-detail'),
|
||||||
|
url(r'^$', SOAdditionalLineItemList.as_view(), name='api-so-additional-line-list'),
|
||||||
|
])),
|
||||||
|
|
||||||
# API endpoints for sales order allocations
|
# API endpoints for sales order allocations
|
||||||
url(r'^so-allocation/', include([
|
url(r'^so-allocation/', include([
|
||||||
url(r'^(?P<pk>\d+)/$', SOAllocationDetail.as_view(), name='api-so-allocation-detail'),
|
url(r'^(?P<pk>\d+)/$', SOAllocationDetail.as_view(), name='api-so-allocation-detail'),
|
||||||
|
@ -1175,6 +1175,9 @@ class SalesOrderAdditionalLineItem(OrderLineItem):
|
|||||||
title: titile of line item
|
title: titile of line item
|
||||||
sale_price: The unit sale price for this OrderLineItem
|
sale_price: The unit sale price for this OrderLineItem
|
||||||
"""
|
"""
|
||||||
|
@staticmethod
|
||||||
|
def get_api_url():
|
||||||
|
return reverse('api-so-additional-line-list')
|
||||||
|
|
||||||
order = models.ForeignKey(SalesOrder, on_delete=models.CASCADE, related_name='additional_lines', verbose_name=_('Order'), help_text=_('Sales Order'))
|
order = models.ForeignKey(SalesOrder, on_delete=models.CASCADE, related_name='additional_lines', verbose_name=_('Order'), help_text=_('Sales Order'))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user