mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Limit supplierpart part link to purchasable parts only
This commit is contained in:
parent
cd0b6a6511
commit
5cd837be07
19
InvenTree/part/migrations/0008_auto_20190417_0013.py
Normal file
19
InvenTree/part/migrations/0008_auto_20190417_0013.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 2.2 on 2019-04-16 14:13
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('part', '0007_auto_20190417_0007'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='supplierpart',
|
||||||
|
name='part',
|
||||||
|
field=models.ForeignKey(limit_choices_to={'purchasable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='supplier_parts', to='part.Part'),
|
||||||
|
),
|
||||||
|
]
|
@ -458,7 +458,9 @@ class SupplierPart(models.Model):
|
|||||||
# Link to an actual part
|
# Link to an actual part
|
||||||
# The part will have a field 'supplier_parts' which links to the supplier part options
|
# The part will have a field 'supplier_parts' which links to the supplier part options
|
||||||
part = models.ForeignKey(Part, on_delete=models.CASCADE,
|
part = models.ForeignKey(Part, on_delete=models.CASCADE,
|
||||||
related_name='supplier_parts')
|
related_name='supplier_parts',
|
||||||
|
limit_choices_to={'purchasable': True},
|
||||||
|
)
|
||||||
|
|
||||||
supplier = models.ForeignKey(Company, on_delete=models.CASCADE,
|
supplier = models.ForeignKey(Company, on_delete=models.CASCADE,
|
||||||
related_name='parts')
|
related_name='parts')
|
||||||
|
Loading…
Reference in New Issue
Block a user