mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 21:45:39 +00:00
Improve part "guess" algorithm
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user