From 3b238fdbba06a84b0b42d348762e2339efc43022 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:21:29 +1000 Subject: [PATCH] Fix for potential NoReverseMatch error (#5440) (#5442) - Check that the database model really does exist in the template code (cherry picked from commit a8118ed406a1c41986738e4ff6f16b445cbc1b10) Co-authored-by: Oliver --- InvenTree/stock/templates/stock/item_base.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index 618413b562..be9a5b0028 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -368,7 +368,11 @@ {% trans "Sales Order" %} - {{ item.sales_order.reference }} - {{ item.sales_order.customer.name }} + + {{ item.sales_order.reference }} + {% if item.sales_order.customer %} + - {{ item.sales_order.customer.name }} + {% endif %} {% else %} {% if allocated_to_sales_orders %}