diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 5f415cd8d9..8db3d7095b 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -68,6 +68,12 @@ class StockItem(models.Model): pe=str(self.part)) }) + if self.part is not None: + if self.part.trackable and not self.serial: + raise ValidationError({ + 'serial': _('Serial number must be set for trackable items') + }) + except Part.DoesNotExist: # This gets thrown if self.supplier_part is null # TODO - Find a test than can be perfomed...