2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Validate uniqueness for StockItems

- If the Part is a variant of a template, ensure that the serial numbers are unique across all instances of the template
- Prevent instantiation of a StockItem for a part which has variants
This commit is contained in:
Oliver Walters
2019-05-25 23:09:04 +10:00
parent bc778c1451
commit d70110690b
3 changed files with 51 additions and 12 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 2.2 on 2019-05-25 13:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('stock', '0002_auto_20190525_2226'),
]
operations = [
migrations.AlterField(
model_name='stockitem',
name='part',
field=models.ForeignKey(help_text='Base part', limit_choices_to={'active': True, 'has_variants': False}, on_delete=django.db.models.deletion.CASCADE, related_name='stock_items', to='part.Part'),
),
]