diff --git a/InvenTree/InvenTree/version.py b/InvenTree/InvenTree/version.py index 03ee877cb2..39d071e182 100644 --- a/InvenTree/InvenTree/version.py +++ b/InvenTree/InvenTree/version.py @@ -10,12 +10,16 @@ import common.models INVENTREE_SW_VERSION = "0.6.0 dev" -INVENTREE_API_VERSION = 14 +INVENTREE_API_VERSION = 15 """ Increment this API version number whenever there is a significant change to the API that any clients need to know about -v14 -> 2021-20-05 +v15 -> 2021-10-06 + - Adds detail endpoint for SalesOrderAllocation model + - Allows use of the API forms interface for adjusting SalesOrderAllocation objects + +v14 -> 2021-10-05 - Stock adjustment actions API is improved, using native DRF serializer support - However adjustment actions now only support 'pk' as a lookup field diff --git a/InvenTree/order/api.py b/InvenTree/order/api.py index 26e6ed3546..af52fd0dec 100644 --- a/InvenTree/order/api.py +++ b/InvenTree/order/api.py @@ -631,6 +631,15 @@ class SOLineItemDetail(generics.RetrieveUpdateDestroyAPIView): serializer_class = SOLineItemSerializer +class SOAllocationDetail(generics.RetrieveUpdateDestroyAPIView): + """ + API endpoint for detali view of a SalesOrderAllocation object + """ + + queryset = SalesOrderAllocation.objects.all() + serializer_class = SalesOrderAllocationSerializer + + class SOAllocationList(generics.ListCreateAPIView): """ API endpoint for listing SalesOrderAllocation objects diff --git a/InvenTree/order/serializers.py b/InvenTree/order/serializers.py index cc4812d1ca..40cd2def58 100644 --- a/InvenTree/order/serializers.py +++ b/InvenTree/order/serializers.py @@ -478,7 +478,7 @@ class SalesOrderAllocationSerializer(InvenTreeModelSerializer): part = serializers.PrimaryKeyRelatedField(source='item.part', read_only=True) order = serializers.PrimaryKeyRelatedField(source='line.order', many=False, read_only=True) serial = serializers.CharField(source='get_serial', read_only=True) - quantity = serializers.FloatField(read_only=True) + quantity = serializers.FloatField(read_only=False) location = serializers.PrimaryKeyRelatedField(source='item.location', many=False, read_only=True) # Extra detail fields