mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Trackable items must have serial number set
This commit is contained in:
parent
feb45513f7
commit
3403af18c8
@ -68,6 +68,12 @@ class StockItem(models.Model):
|
|||||||
pe=str(self.part))
|
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:
|
except Part.DoesNotExist:
|
||||||
# This gets thrown if self.supplier_part is null
|
# This gets thrown if self.supplier_part is null
|
||||||
# TODO - Find a test than can be perfomed...
|
# TODO - Find a test than can be perfomed...
|
||||||
|
Loading…
Reference in New Issue
Block a user