From c45c4e236efc45bcb709c62e8caef78cbf68a8cb Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 1 Sep 2019 23:18:28 +1000 Subject: [PATCH] Point new stockitem to the correct build --- InvenTree/build/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/InvenTree/build/models.py b/InvenTree/build/models.py index 1ceedf63e2..2ae3f0c5a7 100644 --- a/InvenTree/build/models.py +++ b/InvenTree/build/models.py @@ -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 '',