mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-06 10:21:18 +00:00
Bug fix - ensure pk is set to None
This commit is contained in:
1 parent
7db938eda0
commit
906766cc0e
1 file changed
+1
@@ -494,6 +494,7 @@ class StockItem(models.Model):
|
||||
# Create a new StockItem object, duplicating relevant fields
|
||||
# Nullify the PK so a new record is created
|
||||
new_stock = StockItem.objects.get(pk=self.pk)
|
||||
new_stock.pk = None
|
||||
new_stock.quantity = quantity
|
||||
new_stock.save()
|
||||
|
||||
|
||||
Reference in new issue
Block a user