From 7dd960a29930f2180a585952518e2b5a73334de8 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 1 May 2019 08:19:57 +1000 Subject: [PATCH] PEP fixes --- InvenTree/build/models.py | 6 ++---- InvenTree/build/views.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) 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