mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 12:35:46 +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:
@ -3,7 +3,6 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db.utils import IntegrityError
|
||||
|
||||
from InvenTree import status_codes as status
|
||||
|
||||
@ -194,14 +193,13 @@ class BuildTest(BuildTestBase):
|
||||
b.save()
|
||||
|
||||
def test_duplicate_bom_line(self):
|
||||
# Try to add a duplicate BOM item - it should fail!
|
||||
# Try to add a duplicate BOM item - it should be allowed
|
||||
|
||||
with self.assertRaises(IntegrityError):
|
||||
BomItem.objects.create(
|
||||
part=self.assembly,
|
||||
sub_part=self.sub_part_1,
|
||||
quantity=99
|
||||
)
|
||||
BomItem.objects.create(
|
||||
part=self.assembly,
|
||||
sub_part=self.sub_part_1,
|
||||
quantity=99
|
||||
)
|
||||
|
||||
def allocate_stock(self, output, allocations):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user