Place uninstalled items back in stock (#4994)

reset the consumed_by field as well as belongs_to, so an uninstalled
item can be reused.

Fixes: #4992
This commit is contained in:
Matt Brown 2023-06-08 22:22:50 +12:00 committed by GitHub
parent 81413e02c4
commit a4b4df5ff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1261,6 +1261,7 @@ class StockItem(InvenTreeBarcodeMixin, InvenTreeNotesMixin, MetadataMixin, commo
# Mark this stock item as *not* belonging to anyone
self.belongs_to = None
self.consumed_by = None
self.location = location
self.save()