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:
@ -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.
|
||||
|
Reference in New Issue
Block a user