2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-19 18:05:54 +00:00

Rename field part.has_variants to part.is_template

This commit is contained in:
Oliver Walters
2019-05-25 23:58:31 +10:00
parent c3d75deb16
commit c45a506a10
12 changed files with 95 additions and 14 deletions

View File

@@ -159,7 +159,7 @@ class StockItem(models.Model):
})
# A template part cannot be instantiated as a StockItem
if self.part.has_variants:
if self.part.is_template:
raise ValidationError({
'part': _('Stock item cannot be created for a template Part')
})
@@ -213,7 +213,7 @@ class StockItem(models.Model):
part = models.ForeignKey('part.Part', on_delete=models.CASCADE,
related_name='stock_items', help_text='Base part',
limit_choices_to={
'has_variants': False,
'is_template': False,
'active': True,
})