2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

Updated Part model

- Added 'default_location'
- Added 'default_supplier'
This commit is contained in:
Oliver
2018-04-17 18:23:24 +10:00
parent 45c5edee4d
commit 982803a0a7
6 changed files with 80 additions and 1 deletions

View File

@ -106,6 +106,18 @@ class Part(models.Model):
image = models.ImageField(upload_to=rename_part_image, max_length=255, null=True, blank=True)
default_location = models.ForeignKey('stock.StockLocation', on_delete=models.SET_NULL,
blank=True, null=True,
help_text='Where is this item normally stored?',
related_name='default_parts')
# Default supplier part
default_supplier = models.ForeignKey('supplier.SupplierPart',
on_delete=models.SET_NULL,
blank=True, null=True,
help_text='Default supplier part',
related_name='default_parts')
# Minimum "allowed" stock level
minimum_stock = models.PositiveIntegerField(default=0, validators=[MinValueValidator(0)], help_text='Minimum allowed stock level')