2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 03:30:54 +00:00

PEP fixes for /stock

This commit is contained in:
Oliver Walters
2019-04-14 09:23:24 +10:00
parent c3312ac935
commit 76b0d17b11
5 changed files with 93 additions and 49 deletions

View File

@ -69,12 +69,11 @@ class StockItem(models.Model):
if add_note:
# This StockItem is being saved for the first time
self.add_transaction_note(
'Created stock item',
None,
system=True
'Created stock item',
None,
system=True
)
def clean(self):
# The 'supplier_part' field must point to the same part!
@ -227,8 +226,10 @@ class StockItem(models.Model):
if location.pk == self.location.pk:
return False # raise forms.ValidationError("Cannot move item to its current location")
msg = "Moved to {loc} (from {src})".format(loc=location.name,
src=self.location.name)
msg = "Moved to {loc} (from {src})".format(
loc=location.name,
src=self.location.name
)
self.location = location
self.save()
@ -240,7 +241,6 @@ class StockItem(models.Model):
return True
@transaction.atomic
def stocktake(self, count, user, notes=''):
""" Perform item stocktake.