Remove unique-together requirement

- This is handled manually via the validate_unique function
This commit is contained in:
Oliver Walters 2020-05-28 20:38:24 +10:00
parent 774e26eb19
commit 59d9e430b4
2 changed files with 17 additions and 5 deletions

View File

@ -0,0 +1,17 @@
# Generated by Django 3.0.5 on 2020-05-28 10:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stock', '0043_auto_20200525_0420'),
]
operations = [
migrations.AlterUniqueTogether(
name='stockitem',
unique_together=set(),
),
]

View File

@ -292,11 +292,6 @@ class StockItem(MPTTModel):
def get_part_name(self): def get_part_name(self):
return self.part.full_name return self.part.full_name
class Meta:
unique_together = [
('part', 'serial'),
]
def format_barcode(self): def format_barcode(self):
""" Return a JSON string for formatting a barcode for this StockItem. """ Return a JSON string for formatting a barcode for this StockItem.
Can be used to perform lookup of a stockitem using barcode Can be used to perform lookup of a stockitem using barcode