mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge remote-tracking branch 'inventree/master'
This commit is contained in:
commit
5659b38f43
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -90,6 +90,8 @@ class StockMetadata(generics.RetrieveUpdateAPIView):
|
|||||||
class StockItemContextMixin:
|
class StockItemContextMixin:
|
||||||
"""Mixin class for adding StockItem object to serializer context."""
|
"""Mixin class for adding StockItem object to serializer context."""
|
||||||
|
|
||||||
|
queryset = StockItem.objects.none()
|
||||||
|
|
||||||
def get_serializer_context(self):
|
def get_serializer_context(self):
|
||||||
"""Extend serializer context."""
|
"""Extend serializer context."""
|
||||||
context = super().get_serializer_context()
|
context = super().get_serializer_context()
|
||||||
@ -106,7 +108,6 @@ class StockItemContextMixin:
|
|||||||
class StockItemSerialize(StockItemContextMixin, generics.CreateAPIView):
|
class StockItemSerialize(StockItemContextMixin, generics.CreateAPIView):
|
||||||
"""API endpoint for serializing a stock item."""
|
"""API endpoint for serializing a stock item."""
|
||||||
|
|
||||||
queryset = StockItem.objects.all()
|
|
||||||
serializer_class = StockSerializers.SerializeStockItemSerializer
|
serializer_class = StockSerializers.SerializeStockItemSerializer
|
||||||
|
|
||||||
|
|
||||||
@ -118,21 +119,18 @@ class StockItemInstall(StockItemContextMixin, generics.CreateAPIView):
|
|||||||
- stock_item must be serialized (and not belong to another item)
|
- stock_item must be serialized (and not belong to another item)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
queryset = StockItem.objects.all()
|
|
||||||
serializer_class = StockSerializers.InstallStockItemSerializer
|
serializer_class = StockSerializers.InstallStockItemSerializer
|
||||||
|
|
||||||
|
|
||||||
class StockItemUninstall(StockItemContextMixin, generics.CreateAPIView):
|
class StockItemUninstall(StockItemContextMixin, generics.CreateAPIView):
|
||||||
"""API endpoint for removing (uninstalling) items from this item."""
|
"""API endpoint for removing (uninstalling) items from this item."""
|
||||||
|
|
||||||
queryset = StockItem.objects.all()
|
|
||||||
serializer_class = StockSerializers.UninstallStockItemSerializer
|
serializer_class = StockSerializers.UninstallStockItemSerializer
|
||||||
|
|
||||||
|
|
||||||
class StockItemReturn(StockItemContextMixin, generics.CreateAPIView):
|
class StockItemReturn(StockItemContextMixin, generics.CreateAPIView):
|
||||||
"""API endpoint for returning a stock item from a customer"""
|
"""API endpoint for returning a stock item from a customer"""
|
||||||
|
|
||||||
queryset = StockItem.objects.all()
|
|
||||||
serializer_class = StockSerializers.ReturnStockItemSerializer
|
serializer_class = StockSerializers.ReturnStockItemSerializer
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user