mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Limit choices for Part selection
Based on is_template / virtual / active status
This commit is contained in:
19
InvenTree/stock/migrations/0023_auto_20200318_1027.py
Normal file
19
InvenTree/stock/migrations/0023_auto_20200318_1027.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2.9 on 2020-03-18 10:27
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('stock', '0022_auto_20200217_1109'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='stockitem',
|
||||
name='part',
|
||||
field=models.ForeignKey(help_text='Base part', limit_choices_to={'active': True, 'is_template': False, 'virtual': False}, on_delete=django.db.models.deletion.CASCADE, related_name='stock_items', to='part.Part'),
|
||||
),
|
||||
]
|
@ -307,6 +307,7 @@ class StockItem(MPTTModel):
|
||||
limit_choices_to={
|
||||
'is_template': False,
|
||||
'active': True,
|
||||
'virtual': False
|
||||
})
|
||||
|
||||
supplier_part = models.ForeignKey('company.SupplierPart', blank=True, null=True, on_delete=models.SET_NULL,
|
||||
|
Reference in New Issue
Block a user