2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 05:46:34 +00:00

Add ablity to serialize an existing quantity of stock

- Do not have to serialize all the stock
- Add tests
- Add function to copy entire stock transaction history
This commit is contained in:
Oliver Walters
2019-08-28 21:12:16 +10:00
parent bc03ae53bd
commit 43967e302b
4 changed files with 172 additions and 4 deletions

View File

@ -43,6 +43,7 @@
name: 'Widget'
description: 'A watchamacallit'
category: 7
trackable: true
- model: part.part
pk: 50

View File

@ -843,7 +843,8 @@ class Part(models.Model):
# Copy the BOM data
if kwargs.get('bom', False):
for item in other.bom_items.all():
# Point the item to THIS part
# Point the item to THIS part.
# Set the pk to None so a new entry is created.
item.part = self
item.pk = None
item.save()