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:
|
if part_id:
|
||||||
try:
|
try:
|
||||||
part = Part.objects.get(pk=part_id)
|
part = Part.objects.get(pk=part_id)
|
||||||
|
# Check that the supplied part is 'valid'
|
||||||
|
if not part.is_template and part.active and not part.virtual:
|
||||||
initials['part'] = part
|
initials['part'] = part
|
||||||
initials['location'] = part.get_default_location()
|
initials['location'] = part.get_default_location()
|
||||||
initials['supplier_part'] = part.default_supplier
|
initials['supplier_part'] = part.default_supplier
|
||||||
|
|
||||||
except (ValueError, Part.DoesNotExist):
|
except (ValueError, Part.DoesNotExist):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user