2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 11:40:58 +00:00

Further assorted updates

What, you need more commit details?! Pah
This commit is contained in:
Oliver
2018-05-07 23:40:17 +10:00
parent b6944620dd
commit fdf214626c
5 changed files with 36 additions and 28 deletions

View File

@ -57,6 +57,23 @@ class StockItem(models.Model):
If a serial number is assigned, then StockItem cannot have a quantity other than 1
"""
def save(self, *args, **kwargs):
if not self.pk:
add_note = True
else:
add_note = False
super(StockItem, self).save(*args, **kwargs)
if add_note:
# This StockItem is being saved for the first time
self.add_transaction_note(
'Created stock item',
None,
system=True
)
def clean(self):
# The 'supplier_part' field must point to the same part!