Fix internal server error when serializing stock with no location

This commit is contained in:
Ben Charlton 2020-08-24 18:04:22 +01:00
parent 2a4b9c6c5c
commit 9149aa1536

View File

@ -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