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

Fix part deletion template

- Display list of stock items which will be thusly deleted
This commit is contained in:
Oliver Walters
2019-07-23 11:55:51 +10:00
parent b546b5e0cc
commit a42371598c
3 changed files with 13 additions and 8 deletions

View File

@ -528,9 +528,14 @@ class StockItem(models.Model):
return True
def __str__(self):
s = '{n} x {part}'.format(
n=self.quantity,
part=self.part.full_name)
if self.part.trackable and self.serial:
s = '{part} #{sn}'.format(
part=self.part.full_name,
sn=self.serial)
else:
s = '{n} x {part}'.format(
n=self.quantity,
part=self.part.full_name)
if self.location:
s += ' @ {loc}'.format(loc=self.location.name)