mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-13 10:35:40 +00:00
Add some unit testing for the new model
This commit is contained in:
@ -2629,6 +2629,12 @@ class BomItemSubstitute(models.Model):
|
||||
# Prevent duplication of substitute parts
|
||||
unique_together = ('part', 'bom_item')
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
|
||||
self.full_clean()
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def validate_unique(self, exclude=None):
|
||||
"""
|
||||
Ensure that this BomItemSubstitute is "unique":
|
||||
|
Reference in New Issue
Block a user