2
0
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:
Oliver Walters
2020-11-02 01:24:31 +11:00
parent f1b83f1c17
commit b02c87ea50
16 changed files with 487 additions and 561 deletions

View File

@ -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