2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-06 05:30:56 +00:00

Bug fix for stock serial numbers:

- empty strings do not count as a valid serial number
This commit is contained in:
Oliver Walters
2022-03-06 22:18:31 +11:00
parent 004ced8030
commit 89f2317e1c
2 changed files with 35 additions and 1 deletions

View File

@ -350,7 +350,7 @@ class StockItem(MPTTModel):
@property
def serialized(self):
""" Return True if this StockItem is serialized """
return self.serial is not None and self.quantity == 1
return self.serial is not None and len(str(self.serial).strip()) > 0 and self.quantity == 1
def validate_unique(self, exclude=None):
"""