From 7bcf9bf5be7e3ef9f07ae49755199b78e4af1669 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 27 May 2020 10:06:18 +1000 Subject: [PATCH] Allow template parts to be specified for the BOM item --- .../migrations/0043_auto_20200527_0005.py | 24 +++++++++++++++++++ InvenTree/part/models.py | 2 -- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 InvenTree/part/migrations/0043_auto_20200527_0005.py diff --git a/InvenTree/part/migrations/0043_auto_20200527_0005.py b/InvenTree/part/migrations/0043_auto_20200527_0005.py new file mode 100644 index 0000000000..72d1c1ddc4 --- /dev/null +++ b/InvenTree/part/migrations/0043_auto_20200527_0005.py @@ -0,0 +1,24 @@ +# Generated by Django 3.0.5 on 2020-05-27 00:05 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('part', '0042_auto_20200518_0900'), + ] + + operations = [ + migrations.AlterField( + model_name='bomitem', + name='part', + field=models.ForeignKey(help_text='Select parent part', limit_choices_to={'assembly': 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(help_text='Select part to be used in BOM', limit_choices_to={'component': True}, on_delete=django.db.models.deletion.CASCADE, related_name='used_in', to='part.Part'), + ), + ] diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 1a8048a985..359d0a1aa2 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -1364,7 +1364,6 @@ class BomItem(models.Model): help_text=_('Select parent part'), limit_choices_to={ 'assembly': True, - 'is_template': False, }) # A link to the child item (sub-part) @@ -1373,7 +1372,6 @@ class BomItem(models.Model): help_text=_('Select part to be used in BOM'), limit_choices_to={ 'component': True, - 'is_template': False, }) # Quantity required