mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adds new fields to the SupplierPart model:
- available - availability_updated
This commit is contained in:
parent
a8a543755f
commit
59fb2ac21f
24
InvenTree/company/migrations/0044_auto_20220606_1434.py
Normal file
24
InvenTree/company/migrations/0044_auto_20220606_1434.py
Normal file
@ -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'),
|
||||||
|
),
|
||||||
|
]
|
@ -528,6 +528,18 @@ class SupplierPart(models.Model):
|
|||||||
# TODO - Reimplement lead-time as a charfield with special validation (pattern matching).
|
# TODO - Reimplement lead-time as a charfield with special validation (pattern matching).
|
||||||
# lead_time = models.DurationField(blank=True, null=True)
|
# 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
|
@property
|
||||||
def manufacturer_string(self):
|
def manufacturer_string(self):
|
||||||
"""Format a MPN string for this SupplierPart.
|
"""Format a MPN string for this SupplierPart.
|
||||||
|
Loading…
Reference in New Issue
Block a user