Merge pull request #931 from bcc/bug-serialize-no-location

Fix internal server error when serializing stock with no location
This commit is contained in:
Oliver 2020-08-25 08:38:35 +10:00 committed by GitHub
commit 788d497e87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1120,6 +1120,7 @@ class StockItemSerialize(AjaxUpdateView):
initials['quantity'] = item.quantity
initials['serial_numbers'] = item.part.getSerialNumberString(item.quantity)
if item.location is not None:
initials['destination'] = item.location.pk
return initials