mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1163 from SchrodingersGat/hide-purchase-price
Hide purchase price field for non-purchaseable parts
This commit is contained in:
commit
70cac17138
@ -1292,6 +1292,7 @@ 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()
|
||||
else:
|
||||
query = form.fields['supplier_part'].queryset
|
||||
query = query.filter(part=item.part.id)
|
||||
@ -1505,6 +1506,9 @@ class StockItemCreate(AjaxCreateView):
|
||||
|
||||
form.rebuild_layout()
|
||||
|
||||
if not part.purchaseable:
|
||||
form.fields['purchase_price'].widget = HiddenInput()
|
||||
|
||||
# Hide the 'part' field (as a valid part is selected)
|
||||
# form.fields['part'].widget = HiddenInput()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user