mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	| @@ -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 | ||||
|   | ||||
| @@ -6,13 +6,17 @@ | ||||
|     <li{% if tab == 'parts' %} class='active'{% endif %}> | ||||
|         <a href="{% url 'company-detail-parts' company.id %}">Supplier Parts <span class='badge'>{{ company.part_count }}</span></a> | ||||
|     </li> | ||||
|     {% if 0 %} | ||||
|     <li{% if tab == 'po' %} class='active'{% endif %}> | ||||
|         <a href="#">Purchase Orders</a> | ||||
|     </li> | ||||
|     {% endif %} | ||||
|     {% endif %} | ||||
|     {% if company.is_customer %} | ||||
|     {% if 0 %} | ||||
|     <li{% if tab == 'co' %} class='active'{% endif %}> | ||||
|         <a href="#">Sales Orders</a> | ||||
|     </li> | ||||
|     {% endif %} | ||||
|     {% endif %} | ||||
| </ul> | ||||
| @@ -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 | ||||
| @@ -98,7 +99,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 | ||||
|  | ||||
| @@ -457,11 +458,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 | ||||
|  | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user