mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
Limit choices for the 'Part' reference in the new model
This commit is contained in:
parent
71c0406cf3
commit
a95dd86540
19
InvenTree/part/migrations/0050_auto_20200917_2315.py
Normal file
19
InvenTree/part/migrations/0050_auto_20200917_2315.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 3.0.7 on 2020-09-17 23:15
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('part', '0049_partsellpricebreak'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='partsellpricebreak',
|
||||||
|
name='part',
|
||||||
|
field=models.ForeignKey(limit_choices_to={'salable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='salepricebreaks', to='part.Part'),
|
||||||
|
),
|
||||||
|
]
|
@ -1236,7 +1236,8 @@ class PartSellPriceBreak(common.models.PriceBreak):
|
|||||||
|
|
||||||
part = models.ForeignKey(
|
part = models.ForeignKey(
|
||||||
Part, on_delete=models.CASCADE,
|
Part, on_delete=models.CASCADE,
|
||||||
related_name='salepricebreaks'
|
related_name='salepricebreaks',
|
||||||
|
limit_choices_to={'salable': True}
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user