From 9149aa1536b5ef4a03ea7641a5971164932402ef Mon Sep 17 00:00:00 2001 From: Ben Charlton Date: Mon, 24 Aug 2020 18:04:22 +0100 Subject: [PATCH] Fix internal server error when serializing stock with no location --- InvenTree/stock/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index faad9db324..4b62e9903d 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -1120,7 +1120,8 @@ class StockItemSerialize(AjaxUpdateView): initials['quantity'] = item.quantity initials['serial_numbers'] = item.part.getSerialNumberString(item.quantity) - initials['destination'] = item.location.pk + if item.location is not None: + initials['destination'] = item.location.pk return initials