2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Remove unique-together requirement for BomItem model (#3104)

* Remove unique-together requirement for BomItem model

Ref: https://github.com/inventree/InvenTree/issues/1254

* Update unit test

* Remove unused import
This commit is contained in:
Oliver
2022-05-31 13:33:23 +10:00
committed by GitHub
parent 02607bd854
commit a129c650fe
3 changed files with 23 additions and 11 deletions

View File

@ -0,0 +1,17 @@
# Generated by Django 3.2.13 on 2022-05-31 01:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('part', '0076_auto_20220516_0819'),
]
operations = [
migrations.AlterUniqueTogether(
name='bomitem',
unique_together=set(),
),
]

View File

@ -2899,9 +2899,6 @@ class BomItem(models.Model, DataImportMixin):
class Meta:
verbose_name = _("BOM Item")
# Prevent duplication of parent/child rows
unique_together = ('part', 'sub_part')
def __str__(self):
return "{n} x {child} to make {parent}".format(
parent=self.part.full_name,