Point new stockitem to the correct build

This commit is contained in:
Oliver Walters 2019-09-01 23:18:28 +10:00
parent 3cef5c93ce
commit c45c4e236e

View File

@ -237,6 +237,7 @@ class Build(models.Model):
for serial in serial_numbers:
item = StockItem.objects.create(
part=self.part,
build=self,
location=location,
quantity=1,
serial=serial,
@ -250,6 +251,7 @@ class Build(models.Model):
# Add stock of the newly created item
item = StockItem.objects.create(
part=self.part,
build=self,
location=location,
quantity=self.quantity,
batch=str(self.batch) if self.batch else '',