diff --git a/InvenTree/part/migrations/0050_auto_20200917_2315.py b/InvenTree/part/migrations/0050_auto_20200917_2315.py new file mode 100644 index 0000000000..635294093d --- /dev/null +++ b/InvenTree/part/migrations/0050_auto_20200917_2315.py @@ -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'), + ), + ] diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index a3c707bfec..312745344e 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -1236,7 +1236,8 @@ class PartSellPriceBreak(common.models.PriceBreak): part = models.ForeignKey( Part, on_delete=models.CASCADE, - related_name='salepricebreaks' + related_name='salepricebreaks', + limit_choices_to={'salable': True} ) class Meta: