mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1154 from SchrodingersGat/build-delete-fix
Change delete behaviour for parent build item
This commit is contained in:
commit
9dae7c1566
20
InvenTree/build/migrations/0024_auto_20201201_1023.py
Normal file
20
InvenTree/build/migrations/0024_auto_20201201_1023.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 3.0.7 on 2020-11-30 23:23
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
import django.db.models.deletion
|
||||||
|
import mptt.fields
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('build', '0023_auto_20201110_0911'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='build',
|
||||||
|
name='parent',
|
||||||
|
field=mptt.fields.TreeForeignKey(blank=True, help_text='BuildOrder to which this build is allocated', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='children', to='build.Build', verbose_name='Parent Build'),
|
||||||
|
),
|
||||||
|
]
|
@ -83,9 +83,10 @@ class Build(MPTTModel):
|
|||||||
help_text=_('Brief description of the build')
|
help_text=_('Brief description of the build')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO - Perhaps delete the build "tree"
|
||||||
parent = TreeForeignKey(
|
parent = TreeForeignKey(
|
||||||
'self',
|
'self',
|
||||||
on_delete=models.DO_NOTHING,
|
on_delete=models.SET_NULL,
|
||||||
blank=True, null=True,
|
blank=True, null=True,
|
||||||
related_name='children',
|
related_name='children',
|
||||||
verbose_name=_('Parent Build'),
|
verbose_name=_('Parent Build'),
|
||||||
|
Loading…
Reference in New Issue
Block a user