From 4cad8d16f395c447acffc241d90757cdf72109c0 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 24 Sep 2024 01:36:45 +0200 Subject: [PATCH] remove unused definition - the view is read only --- src/backend/InvenTree/stock/api.py | 36 ------------------------------ 1 file changed, 36 deletions(-) diff --git a/src/backend/InvenTree/stock/api.py b/src/backend/InvenTree/stock/api.py index d2226f529e85..69f05486ed59 100644 --- a/src/backend/InvenTree/stock/api.py +++ b/src/backend/InvenTree/stock/api.py @@ -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.