2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Limit choices for BomItem Part foreignkey fields

- Only allow 'active' Parts
This commit is contained in:
Oliver Walters
2019-05-05 22:34:00 +10:00
parent 5a9fc399ac
commit b85a4d0895
2 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,24 @@
# Generated by Django 2.2 on 2019-05-05 12:31
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('part', '0017_auto_20190505_0848'),
]
operations = [
migrations.AlterField(
model_name='bomitem',
name='part',
field=models.ForeignKey(limit_choices_to={'active': True, 'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='bom_items', to='part.Part'),
),
migrations.AlterField(
model_name='bomitem',
name='sub_part',
field=models.ForeignKey(limit_choices_to={'active': True, 'consumable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='used_in', to='part.Part'),
),
]