diff --git a/InvenTree/company/migrations/0044_auto_20220606_1434.py b/InvenTree/company/migrations/0044_auto_20220606_1434.py new file mode 100644 index 0000000000..ef31115080 --- /dev/null +++ b/InvenTree/company/migrations/0044_auto_20220606_1434.py @@ -0,0 +1,24 @@ +# Generated by Django 3.2.13 on 2022-06-06 14:34 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('company', '0043_manufacturerpartattachment'), + ] + + operations = [ + migrations.AddField( + model_name='supplierpart', + name='availability_updated', + field=models.DateTimeField(help_text='Date of last update of availability data', null=True, verbose_name='Availability Updated'), + ), + migrations.AddField( + model_name='supplierpart', + name='available', + field=models.DecimalField(decimal_places=3, default=0, help_text='Quantity available from supplier', max_digits=10, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Available'), + ), + ] diff --git a/InvenTree/company/models.py b/InvenTree/company/models.py index 0af1ec73bc..7e51255bae 100644 --- a/InvenTree/company/models.py +++ b/InvenTree/company/models.py @@ -528,6 +528,18 @@ class SupplierPart(models.Model): # TODO - Reimplement lead-time as a charfield with special validation (pattern matching). # lead_time = models.DurationField(blank=True, null=True) + available = models.DecimalField( + max_digits=10, decimal_places=3, default=0, + validators=[MinValueValidator(0)], + verbose_name=_('Available'), + help_text=_('Quantity available from supplier'), + ) + + availability_updated = models.DateTimeField( + null=True, verbose_name=_('Availability Updated'), + help_text=_('Date of last update of availability data'), + ) + @property def manufacturer_string(self): """Format a MPN string for this SupplierPart.