From aa962aac83b16b9710bfadce6178976cd8598d7c Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 9 Feb 2022 23:26:13 +1100 Subject: [PATCH] Improve part "guess" algorithm --- InvenTree/part/serializers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/part/serializers.py b/InvenTree/part/serializers.py index 2ec2c43707..c5f5216f38 100644 --- a/InvenTree/part/serializers.py +++ b/InvenTree/part/serializers.py @@ -924,13 +924,13 @@ class BomExtractSerializer(serializers.Serializer): if part is None: - if part_name is not None or part_ipn is not None: + if part_name or part_ipn: queryset = Part.objects.all() - if part_name is not None: + if part_name: queryset = queryset.filter(name=part_name) - if part_ipn is not None: + if part_ipn: queryset = queryset.filter(IPN=part_ipn) # Only if we have a single direct match