From 0d052334e20b4f0a4f0a5b99de0b33d2b3e1bde3 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 25 May 2020 14:20:35 +1000 Subject: [PATCH] Allow stock items to be created for template parts --- .../migrations/0043_auto_20200525_0420.py | 20 +++++++++++++++++++ InvenTree/stock/models.py | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 InvenTree/stock/migrations/0043_auto_20200525_0420.py diff --git a/InvenTree/stock/migrations/0043_auto_20200525_0420.py b/InvenTree/stock/migrations/0043_auto_20200525_0420.py new file mode 100644 index 0000000000..4acc19edf2 --- /dev/null +++ b/InvenTree/stock/migrations/0043_auto_20200525_0420.py @@ -0,0 +1,20 @@ +# Generated by Django 3.0.5 on 2020-05-25 04:20 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('part', '0042_auto_20200518_0900'), + ('stock', '0042_auto_20200523_0121'), + ] + + operations = [ + migrations.AlterField( + model_name='stockitem', + name='part', + field=models.ForeignKey(help_text='Base part', limit_choices_to={'active': True, 'virtual': False}, on_delete=django.db.models.deletion.CASCADE, related_name='stock_items', to='part.Part', verbose_name='Base Part'), + ), + ] diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 90a6fd365c..3d9394979c 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -331,7 +331,6 @@ class StockItem(MPTTModel): verbose_name=_('Base Part'), related_name='stock_items', help_text=_('Base part'), limit_choices_to={ - 'is_template': False, 'active': True, 'virtual': False })