mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Hide purchase price field for non-purchaseable parts
This commit is contained in:
parent
1c168452a4
commit
648595cf18
@ -1292,6 +1292,7 @@ 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()
|
||||||
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)
|
||||||
@ -1505,6 +1506,9 @@ class StockItemCreate(AjaxCreateView):
|
|||||||
|
|
||||||
form.rebuild_layout()
|
form.rebuild_layout()
|
||||||
|
|
||||||
|
if not part.purchaseable:
|
||||||
|
form.fields['purchase_price'].widget = HiddenInput()
|
||||||
|
|
||||||
# Hide the 'part' field (as a valid part is selected)
|
# Hide the 'part' field (as a valid part is selected)
|
||||||
# form.fields['part'].widget = HiddenInput()
|
# form.fields['part'].widget = HiddenInput()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user