2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

Add 'default_keywords' field to a category

This commit is contained in:
Oliver Walters
2019-05-14 17:30:24 +10:00
parent 02033c2157
commit 0842bd5833
3 changed files with 28 additions and 1 deletions

View File

@ -37,6 +37,12 @@ from company.models import Company
class PartCategory(InvenTreeTree):
""" PartCategory provides hierarchical organization of Part objects.
Attributes:
name: Name of this category
parent: Parent category
default_location: Default storage location for parts in this category or child categories
default_keywords: Default keywords for parts created in this category
"""
default_location = models.ForeignKey(
@ -46,6 +52,8 @@ class PartCategory(InvenTreeTree):
help_text='Default location for parts in this category'
)
default_keywords = models.CharField(blank=True, max_length=250, help_text='Default keywords for parts in this category')
def get_absolute_url(self):
return reverse('category-detail', kwargs={'pk': self.id})