From e9f41a83576f26b08e3f13b4c7e380184752b224 Mon Sep 17 00:00:00 2001
From: eeintech <eeintech@eeinte.ch>
Date: Fri, 14 May 2021 16:38:30 -0400
Subject: [PATCH] Currency finding fix

---
 InvenTree/part/api.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py
index 065eca30c6..5bdd572145 100644
--- a/InvenTree/part/api.py
+++ b/InvenTree/part/api.py
@@ -928,7 +928,7 @@ class BomList(generics.ListCreateAPIView):
             # Find associated currency (select first found)
             purchase_price_currency = None
             for currency_item in currencies:
-                if currency_item['pk'] == bom_item.pk and currency_item['sub_part'] == bom_item.sub_part:
+                if currency_item['pk'] == bom_item.pk and currency_item['sub_part'] == bom_item.sub_part.pk:
                     purchase_price_currency = currency_item['purchase_price_currency']
                     break
             # Convert prices