From 997d68694e4e51e8b72a0c9e8fb277474f22c913 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 17 Jun 2021 18:21:11 +0200 Subject: [PATCH 1/2] fix for part with no bom-price #1678 --- .../part/templates/part/order_prices.html | 12 +++---- InvenTree/part/views.py | 31 ++++++++++++------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/InvenTree/part/templates/part/order_prices.html b/InvenTree/part/templates/part/order_prices.html index f5af15afef..7e38770386 100644 --- a/InvenTree/part/templates/part/order_prices.html +++ b/InvenTree/part/templates/part/order_prices.html @@ -198,18 +198,18 @@ The part single price is the current purchase price for that supplier part."> Date: Thu, 17 Jun 2021 18:25:05 +0200 Subject: [PATCH 2/2] style-fix --- InvenTree/part/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index ba3b80891c..d996d81c66 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -847,9 +847,9 @@ class PartPricingView(PartDetail): # BOM Information for Pie-Chart if part.has_bom: - # iterate over all bom-items ctx_bom_parts = [] - for item in part.bom_items.all(): + # iterate over all bom-items + for item in part.bom_items.all(): ctx_item = {'name': str(item.sub_part)} price, qty = item.sub_part.get_price_range(quantity), item.quantity @@ -858,7 +858,7 @@ class PartPricingView(PartDetail): price_min = str((price[0] * qty) / quantity) if len(set(price)) == 2: # min and max-price present price_max = str((price[1] * qty) / quantity) - ctx['bom_pie_max'] = True # enable showing min prices in bom + ctx['bom_pie_max'] = True # enable showing max prices in bom ctx_item['max_price'] = price_min ctx_item['min_price'] = price_max if price_max else price_min