mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Bug fix for a code path which resulted in a form failing validation but not showing any errors!
This one has been here for a while!
This commit is contained in:
parent
2b99cf353a
commit
489dfa1823
@ -838,9 +838,12 @@ class StockItemCreate(AjaxCreateView):
|
||||
if part_id:
|
||||
try:
|
||||
part = Part.objects.get(pk=part_id)
|
||||
initials['part'] = part
|
||||
initials['location'] = part.get_default_location()
|
||||
initials['supplier_part'] = part.default_supplier
|
||||
# Check that the supplied part is 'valid'
|
||||
if not part.is_template and part.active and not part.virtual:
|
||||
initials['part'] = part
|
||||
initials['location'] = part.get_default_location()
|
||||
initials['supplier_part'] = part.default_supplier
|
||||
|
||||
except (ValueError, Part.DoesNotExist):
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user