2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 19:15:41 +00:00

Some small tweaks

This commit is contained in:
Oliver Walters
2019-04-28 11:46:53 +10:00
parent e5e6480099
commit ba49b080b0
2 changed files with 9 additions and 1 deletions

View File

@ -77,6 +77,14 @@ class StockItem(models.Model):
)
def clean(self):
""" Validate the StockItem object (separate to field validation)
The following validation checks are performed:
- The 'part' and 'supplier_part.part' fields cannot point to the same Part object
- The 'part' does not belong to itself
- Quantity must be 1 if the StockItem has a serial number
"""
# The 'supplier_part' field must point to the same part!
try: