Skip to content

Commit

Permalink
remove unused definition - the view is read only
Browse files Browse the repository at this point in the history
  • Loading branch information
matmair committed Sep 23, 2024
1 parent db8f92c commit 4cad8d1
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions src/backend/InvenTree/stock/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,42 +1485,6 @@ def list(self, request, *args, **kwargs):
return JsonResponse(data, safe=False)
return Response(data)

def create(self, request, *args, **kwargs):
"""Create a new StockItemTracking object.
Here we override the default 'create' implementation,
to save the user information associated with the request object.
"""
# Clean up input data
data = self.clean_data(request.data)

serializer = self.get_serializer(data=data)
serializer.is_valid(raise_exception=True)

# Record the user who created this Part object
item = serializer.save()
item.user = request.user
item.system = False

# quantity field cannot be explicitly adjusted here
item.quantity = item.item.quantity
item.save()

headers = self.get_success_headers(serializer.data)
return Response(
serializer.data, status=status.HTTP_201_CREATED, headers=headers
)

filter_backends = SEARCH_ORDER_FILTER

filterset_fields = ['item', 'user']

ordering = '-date'

ordering_fields = ['date']

search_fields = ['title', 'notes']


class LocationDetail(CustomRetrieveUpdateDestroyAPI):
"""API endpoint for detail view of StockLocation object.
Expand Down

0 comments on commit 4cad8d1

Please sign in to comment.