mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
More 'limit_choices_to' limitations for template parts
This commit is contained in:
parent
9c1c008f33
commit
c3d75deb16
19
InvenTree/build/migrations/0003_auto_20190525_2355.py
Normal file
19
InvenTree/build/migrations/0003_auto_20190525_2355.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2 on 2019-05-25 13:55
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('build', '0002_auto_20190520_2204'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='build',
|
||||
name='part',
|
||||
field=models.ForeignKey(help_text='Select part to build', limit_choices_to={'active': True, 'buildable': True, 'has_variants': False}, on_delete=django.db.models.deletion.CASCADE, related_name='builds', to='part.Part'),
|
||||
),
|
||||
]
|
@ -50,6 +50,7 @@ class Build(models.Model):
|
||||
part = models.ForeignKey('part.Part', on_delete=models.CASCADE,
|
||||
related_name='builds',
|
||||
limit_choices_to={
|
||||
'has_variants': False,
|
||||
'buildable': True,
|
||||
'active': True
|
||||
},
|
||||
|
19
InvenTree/company/migrations/0004_auto_20190525_2354.py
Normal file
19
InvenTree/company/migrations/0004_auto_20190525_2354.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2 on 2019-05-25 13:54
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('company', '0003_remove_supplierpart_minimum'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='supplierpart',
|
||||
name='part',
|
||||
field=models.ForeignKey(help_text='Select part', limit_choices_to={'has_variants': False, 'purchaseable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='supplier_parts', to='part.Part'),
|
||||
),
|
||||
]
|
@ -188,7 +188,10 @@ class SupplierPart(models.Model):
|
||||
|
||||
part = models.ForeignKey('part.Part', on_delete=models.CASCADE,
|
||||
related_name='supplier_parts',
|
||||
limit_choices_to={'purchaseable': True},
|
||||
limit_choices_to={
|
||||
'purchaseable': True,
|
||||
'has_variants': False,
|
||||
},
|
||||
help_text='Select part',
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user