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
commit 436d158cfe
4 changed files with 13 additions and 6 deletions

View File

@ -28,7 +28,7 @@ SECRET_KEY = key_file.read().strip()
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['*']
if DEBUG:
# will output to your console

View File

@ -12,9 +12,11 @@
</li>
{% endif %}
{% endif %}
{% if company.is_customer and 0 %}
{% if company.is_customer %}
{% if 0 %}
<li{% if tab == 'co' %} class='active'{% endif %}>
<a href="#">Sales Orders</a>
</li>
{% endif %}
</ul>
{% endif %}
</ul>

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

View File

@ -7,6 +7,7 @@ from __future__ import unicode_literals
from django.views.generic import DetailView, ListView
from django.forms.models import model_to_dict
from django.forms import HiddenInput
from InvenTree.views import AjaxUpdateView, AjaxDeleteView, AjaxCreateView
@ -141,6 +142,9 @@ class StockItemCreate(AjaxCreateView):
parts = parts.filter(part=part)
form.fields['supplier_part'].queryset = parts
# Hide the 'part' field
form.fields['part'].widget = HiddenInput()
# Otherwise if the user has selected a SupplierPart, we know what Part they meant!
elif form['supplier_part'].value() is not None:
pass