From b64d48544decbfaf5e709d93e18e44ab0da8127f Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 23 Feb 2021 16:49:09 +1100 Subject: [PATCH 1/3] Bug fix for trackable parts --- InvenTree/part/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index c1dbb454b4..468ceb8cfc 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -643,12 +643,12 @@ class Part(MPTTModel): super().clean() if self.trackable: - for item in self.get_used_in().all(): - parent_part = item.part - if not parent_part.trackable: - parent_part.trackable = True - parent_part.clean() - parent_part.save() + for part in self.get_used_in().all(): + + if not part.trackable: + part.trackable = True + part.clean() + part.save() name = models.CharField( max_length=100, blank=False, From a48be3bea925ace2e424246da829db6696bda973 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 23 Feb 2021 16:57:17 +1100 Subject: [PATCH 2/3] Remove regex search functionality from part api --- InvenTree/part/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index 12bfd2de1d..bae3594da3 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -665,9 +665,9 @@ class PartList(generics.ListCreateAPIView): ordering = 'name' search_fields = [ - '$name', + 'name', 'description', - '$IPN', + 'IPN', 'keywords', ] From 546a1c91ccb272bee987bbe86e8c0ce15a03f496 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 24 Feb 2021 11:05:52 +1100 Subject: [PATCH 3/3] Allow searching part by revision field --- InvenTree/part/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index bae3594da3..e796e714b0 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -668,6 +668,7 @@ class PartList(generics.ListCreateAPIView): 'name', 'description', 'IPN', + 'revision', 'keywords', ]