2
0
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:
Oliver
2021-12-05 18:14:14 +11:00
parent a821717103
commit 93a240d9c3
9 changed files with 35 additions and 107 deletions
-14
View File
@@ -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):