2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 13:35:40 +00:00

Merge remote-tracking branch 'inventree/master' into build-allocation

# Conflicts:
#	InvenTree/company/templates/company/tabs.html
This commit is contained in:
Oliver Walters
2019-05-01 08:15:58 +10:00
4 changed files with 13 additions and 6 deletions

View File

@ -10,6 +10,7 @@ from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.views.generic import DetailView, ListView
from django.forms.models import model_to_dict
from django.forms import HiddenInput
from company.models import Company
from .models import PartCategory, Part, BomItem
@ -97,7 +98,7 @@ class PartCreate(AjaxCreateView):
form = super(AjaxCreateView, self).get_form()
# Hide the default_supplier field (there are no matching supplier parts yet!)
del form.fields['default_supplier']
form.fields['default_supplier'] = HiddenInput()
return form
@ -485,11 +486,11 @@ class SupplierPartCreate(AjaxCreateView):
if form.initial.get('supplier', None):
# Hide the supplier field
form.fields['supplier'].widget.attrs['disabled'] = True
form.fields['supplier'].widget = HiddenInput()
if form.initial.get('part', None):
# Hide the part field
form.fields['part'].widget.attrs['disabled'] = True
form.fields['part'].widget = HiddenInput()
return form