From 2ad090c224ca05d0e6b3c00f8e19a2cbbdb1b9ad Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 3 Jan 2021 13:15:42 +1100 Subject: [PATCH] pop purchase_price field for StockItemEdit form --- InvenTree/stock/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index fdd58f1e96..582c1b5d89 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -1307,7 +1307,8 @@ class StockItemEdit(AjaxUpdateView): # If the part cannot be purchased, hide the supplier_part field if not item.part.purchaseable: form.fields['supplier_part'].widget = HiddenInput() - form.fields['purchase_price'].widget = HiddenInput() + + form.fields.pop('purchase_price') else: query = form.fields['supplier_part'].queryset query = query.filter(part=item.part.id)