2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

pops the purchase_price field instead of using a HiddenInput

Using a HiddenInput on a MoneyFormField causes a validation error, for some reason...
This commit is contained in:
Oliver Walters
2021-01-03 13:13:14 +11:00
parent 11c6248b06
commit fe0d356675
2 changed files with 13 additions and 7 deletions

View File

@ -1522,8 +1522,8 @@ class StockItemCreate(AjaxCreateView):
form.rebuild_layout()
if not part.purchaseable:
form.fields['purchase_price'].widget = HiddenInput()
form.fields.pop('purchase_price')
# Hide the 'part' field (as a valid part is selected)
# form.fields['part'].widget = HiddenInput()