mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Lots of work towards multiple build output
This commit is contained in:
@ -175,7 +175,7 @@ class StockItem(MPTTModel):
|
||||
if add_note:
|
||||
# This StockItem is being saved for the first time
|
||||
self.addTransactionNote(
|
||||
'Created stock item',
|
||||
_('Created stock item'),
|
||||
user,
|
||||
notes="Created new stock item for part '{p}'".format(p=str(self.part)),
|
||||
system=True
|
||||
@ -199,13 +199,7 @@ class StockItem(MPTTModel):
|
||||
"""
|
||||
|
||||
super(StockItem, self).validate_unique(exclude)
|
||||
|
||||
# If the part is trackable, either serial number or batch number must be set
|
||||
if self.part.trackable:
|
||||
if not self.serial and not self.batch:
|
||||
msg = _('Serial or batch number must be specified for trackable stock')
|
||||
raise ValidationError(msg)
|
||||
|
||||
|
||||
# If the serial number is set, make sure it is not a duplicate
|
||||
if self.serial is not None:
|
||||
# Query to look for duplicate serial numbers
|
||||
|
Reference in New Issue
Block a user