From 56b287b2c81e41b446866b525c72a478988c98f6 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 4 Nov 2020 08:29:09 +1100 Subject: [PATCH] Logic fix for editing stock item creation form --- InvenTree/stock/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index 2e45ceb00e..1d58647d5a 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -1505,8 +1505,10 @@ class StockItemCreate(AjaxCreateView): # form.fields['part'].widget = HiddenInput() # Trackable parts get special consideration: - form.fields['delete_on_deplete'].disabled = not part.trackable - form.fields['serial_numbers'].disabled = not part.trackable + if part.trackable: + form.fields['delete_on_deplete'].disabled = True + else: + form.fields['serial_numbers'].disabled = True # If the part is NOT purchaseable, hide the supplier_part field if not part.purchaseable: