diff --git a/InvenTree/build/models.py b/InvenTree/build/models.py index d4e01795a4..711ba3c6a8 100644 --- a/InvenTree/build/models.py +++ b/InvenTree/build/models.py @@ -31,7 +31,7 @@ class Build(models.Model): """ def save(self, *args, **kwargs): - """ Called when the Build model is saved to the database. + """ Called when the Build model is saved to the database. If this is a new Build, try to allocate StockItem objects automatically. @@ -67,13 +67,12 @@ class Build(models.Model): # Allocate parts to this build build_item = BuildItem( - build=self, + build=self, stock_item=stock_item, quantity=q_req) build_item.save() - def __str__(self): return "Build {q} x {part}".format(q=self.quantity, part=str(self.part)) @@ -129,7 +128,6 @@ class Build(models.Model): """ print("cancelled!") - def completeBuild(self): """ Mark the Build as COMPLETE diff --git a/InvenTree/build/views.py b/InvenTree/build/views.py index e23166322d..403f0aa4c5 100644 --- a/InvenTree/build/views.py +++ b/InvenTree/build/views.py @@ -69,7 +69,7 @@ class BuildCancel(AjaxView): class BuildComplete(AjaxView): - """ View to mark a build as Complete. + """ View to mark a build as Complete. - Notifies the user of which parts will be removed from stock. - Removes allocated items from stock