mirror of
https://github.com/inventree/InvenTree.git
synced 2026-05-23 09:35:30 +00:00
Remove the "scheduled_for_deletion" field from the StockItem model
Reverts back to the original behaviour - stock items are just deleted
This commit is contained in:
@@ -86,17 +86,6 @@ class StockDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
|
||||
return self.serializer_class(*args, **kwargs)
|
||||
|
||||
def perform_destroy(self, instance):
|
||||
"""
|
||||
Instead of "deleting" the StockItem
|
||||
(which may take a long time)
|
||||
we instead schedule it for deletion at a later date.
|
||||
|
||||
The background worker will delete these in the future
|
||||
"""
|
||||
|
||||
instance.mark_for_deletion()
|
||||
|
||||
|
||||
class StockItemSerialize(generics.CreateAPIView):
|
||||
"""
|
||||
@@ -623,9 +612,6 @@ class StockList(generics.ListCreateAPIView):
|
||||
|
||||
queryset = StockSerializers.StockItemSerializer.annotate_queryset(queryset)
|
||||
|
||||
# Do not expose StockItem objects which are scheduled for deletion
|
||||
queryset = queryset.filter(scheduled_for_deletion=False)
|
||||
|
||||
return queryset
|
||||
|
||||
def filter_queryset(self, queryset):
|
||||
|
||||
Reference in New Issue
Block a user