From b04a40308151985f29ee88872c896ce82a6a8787 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 20 Jul 2021 22:15:49 +1000 Subject: [PATCH] subclass TreeManager --- InvenTree/part/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index fa19f8b075..49be12e283 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -27,6 +27,7 @@ from markdownx.models import MarkdownxField from django_cleanup import cleanup from mptt.models import TreeForeignKey, MPTTModel +from mptt.managers import TreeManager from stdimage.models import StdImageField @@ -284,7 +285,7 @@ def match_part_names(match, threshold=80, reverse=True, compare_length=False): return matches -class PartManager(models.Manager): +class PartManager(TreeManager): """ Defines a custom object manager for the Part model.