mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +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:
parent
4e3702384b
commit
bc12af5994
@ -91,6 +91,15 @@ class PartCreate(AjaxCreateView):
|
|||||||
|
|
||||||
return context
|
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
|
# Pre-fill the category field if a valid category is provided
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
""" Get initial data for the new Part object:
|
""" Get initial data for the new Part object:
|
||||||
|
Loading…
Reference in New Issue
Block a user