mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 02:55:41 +00:00
Remove the 'supplier_part' field when first creating a Part object
- As the Part does not yet exist, there are no matching SupplierPart objects
This commit is contained in:
@ -91,6 +91,15 @@ class PartCreate(AjaxCreateView):
|
||||
|
||||
return context
|
||||
|
||||
def get_form(self):
|
||||
form = super(AjaxCreateView, self).get_form()
|
||||
|
||||
# Hide the default_supplier field (there are no matching supplier parts yet!)
|
||||
#form.fields['default_supplier'].widget.attrs['hidden'] = True
|
||||
del form.fields['default_supplier']
|
||||
|
||||
return form
|
||||
|
||||
# Pre-fill the category field if a valid category is provided
|
||||
def get_initial(self):
|
||||
""" Get initial data for the new Part object:
|
||||
|
Reference in New Issue
Block a user