diff --git a/InvenTree/part/templates/part/order_prices.html b/InvenTree/part/templates/part/order_prices.html index a9da632a33..5e5552c5f9 100644 --- a/InvenTree/part/templates/part/order_prices.html +++ b/InvenTree/part/templates/part/order_prices.html @@ -137,7 +137,7 @@

{% trans 'Stock Pricing' %}

- {% if price_history|length > 1 %} + {% if price_history|length > 0 %}
diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index b68c889516..39e0f13b45 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -814,7 +814,7 @@ class PartPricingView(PartDetail): part = self.get_part() # Stock history if part.total_stock > 1: - ret = [] + price_history = [] stock = part.stock_entries(include_variants=False, in_stock=True) # .order_by('purchase_order__date') stock = stock.prefetch_related('purchase_order', 'supplier_part') @@ -841,9 +841,9 @@ class PartPricingView(PartDetail): line['date'] = stock_item.purchase_order.issue_date.strftime('%d.%m.%Y') else: line['date'] = stock_item.tracking_info.first().date.strftime('%d.%m.%Y') - ret.append(line) + price_history.append(line) - ctx['price_history'] = ret + ctx['price_history'] = price_history # BOM Information for Pie-Chart if part.has_bom: diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index fa91177bf6..7aebd51452 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -325,7 +325,7 @@ {{ item.purchase_order }} {% endif %} - {% if item.purchase_price %} + {% if item.purchase_price != None %} {% trans "Purchase Price" %}