diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html
index b16d9b0b1a..91c3209013 100644
--- a/InvenTree/stock/templates/stock/item_base.html
+++ b/InvenTree/stock/templates/stock/item_base.html
@@ -253,7 +253,7 @@
{{ previous.serial }} ‹
{% endif %}
- {{ item.serial }}
+ {{ item.serial }}
{% if next %}
› {{ next.serial }}
diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py
index 80968e5aa9..7b6fbc527e 100644
--- a/InvenTree/stock/views.py
+++ b/InvenTree/stock/views.py
@@ -92,21 +92,39 @@ class StockItemDetail(InvenTreeRoleMixin, DetailView):
data = super().get_context_data(**kwargs)
if self.object.serialized:
- serial_elem = {int(a.serial): a for a in self.object.part.stock_items.all() if a.serialized}
- serials = serial_elem.keys()
- current = int(self.object.serial)
- # previous
- for nbr in range(current - 1, -1, -1):
- if nbr in serials:
- data['previous'] = serial_elem.get(nbr, None)
- break
+ serial_elem = {}
- # next
- for nbr in range(current + 1, max(serials) + 1):
- if nbr in serials:
- data['next'] = serial_elem.get(nbr, None)
- break
+ try:
+ current = int(self.object.serial)
+
+ for item in self.object.part.stock_items.all():
+
+ if item.serialized:
+ try:
+ sn = int(item.serial)
+ serial_elem[sn] = item
+ except ValueError:
+ # We only support integer serial number progression
+ pass
+
+ serials = serial_elem.keys()
+
+ # previous
+ for nbr in range(current - 1, min(serials), -1):
+ if nbr in serials:
+ data['previous'] = serial_elem.get(nbr, None)
+ break
+
+ # next
+ for nbr in range(current + 1, max(serials) + 1):
+ if nbr in serials:
+ data['next'] = serial_elem.get(nbr, None)
+ break
+
+ except ValueError:
+ # We only support integer serial number progression
+ pass
return data