2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-10 23:14:13 +00:00

Added checkbox to add parameter template to all categories

This commit is contained in:
eeintech
2020-11-02 12:20:29 -05:00
parent 3a347fba21
commit 978b5f869d
4 changed files with 53 additions and 14 deletions

View File

@ -167,13 +167,10 @@ class PartCategory(InvenTreeTree):
def get_parent_categories(cls):
""" Return tuple list of parent (root) categories """
# Store parent categories (add empty label)
parent_categories = [
('', '-' * 10)
]
# Get root nodes
root_categories = cls.objects.filter(level=0)
parent_categories = []
for category in root_categories:
parent_categories.append((category.id, category.name))