mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-21 14:20:54 +00:00
Add 'has_variants' and 'variant_of' field for Part
- StockItem cannot point to a part which is a template part
This commit is contained in:
24
InvenTree/part/migrations/0003_auto_20190525_2226.py
Normal file
24
InvenTree/part/migrations/0003_auto_20190525_2226.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Generated by Django 2.2 on 2019-05-25 12:26
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('part', '0002_auto_20190520_2204'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='has_variants',
|
||||
field=models.BooleanField(default=False, help_text='Is this part a template part?'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='variant_of',
|
||||
field=models.ForeignKey(blank=True, help_text='Is this part a variant of another part?', limit_choices_to={'active': True, 'has_variants': True}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='variants', to='part.Part'),
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user