pop purchase_price field for StockItemEdit form

This commit is contained in:
Oliver Walters 2021-01-03 13:15:42 +11:00
parent fe0d356675
commit 2ad090c224

View File

@ -1307,7 +1307,8 @@ class StockItemEdit(AjaxUpdateView):
# If the part cannot be purchased, hide the supplier_part field # If the part cannot be purchased, hide the supplier_part field
if not item.part.purchaseable: if not item.part.purchaseable:
form.fields['supplier_part'].widget = HiddenInput() form.fields['supplier_part'].widget = HiddenInput()
form.fields['purchase_price'].widget = HiddenInput()
form.fields.pop('purchase_price')
else: else:
query = form.fields['supplier_part'].queryset query = form.fields['supplier_part'].queryset
query = query.filter(part=item.part.id) query = query.filter(part=item.part.id)