mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	| @@ -28,7 +28,7 @@ SECRET_KEY = key_file.read().strip() | |||||||
| # SECURITY WARNING: don't run with debug turned on in production! | # SECURITY WARNING: don't run with debug turned on in production! | ||||||
| DEBUG = True | DEBUG = True | ||||||
|  |  | ||||||
| ALLOWED_HOSTS = [] | ALLOWED_HOSTS = ['*'] | ||||||
|  |  | ||||||
| if DEBUG: | if DEBUG: | ||||||
|     # will output to your console |     # will output to your console | ||||||
|   | |||||||
| @@ -6,13 +6,17 @@ | |||||||
|     <li{% if tab == 'parts' %} class='active'{% endif %}> |     <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> |         <a href="{% url 'company-detail-parts' company.id %}">Supplier Parts <span class='badge'>{{ company.part_count }}</span></a> | ||||||
|     </li> |     </li> | ||||||
|  |     {% if 0 %} | ||||||
|     <li{% if tab == 'po' %} class='active'{% endif %}> |     <li{% if tab == 'po' %} class='active'{% endif %}> | ||||||
|         <a href="#">Purchase Orders</a> |         <a href="#">Purchase Orders</a> | ||||||
|     </li> |     </li> | ||||||
|     {% endif %} |     {% endif %} | ||||||
|  |     {% endif %} | ||||||
|     {% if company.is_customer %} |     {% if company.is_customer %} | ||||||
|  |     {% if 0 %} | ||||||
|     <li{% if tab == 'co' %} class='active'{% endif %}> |     <li{% if tab == 'co' %} class='active'{% endif %}> | ||||||
|         <a href="#">Sales Orders</a> |         <a href="#">Sales Orders</a> | ||||||
|     </li> |     </li> | ||||||
|     {% endif %} |     {% endif %} | ||||||
|  |     {% endif %} | ||||||
| </ul> | </ul> | ||||||
| @@ -10,6 +10,7 @@ from django.shortcuts import get_object_or_404 | |||||||
| from django.urls import reverse_lazy | from django.urls import reverse_lazy | ||||||
| from django.views.generic import DetailView, ListView | from django.views.generic import DetailView, ListView | ||||||
| from django.forms.models import model_to_dict | from django.forms.models import model_to_dict | ||||||
|  | from django.forms import HiddenInput | ||||||
|  |  | ||||||
| from company.models import Company | from company.models import Company | ||||||
| from .models import PartCategory, Part, BomItem | from .models import PartCategory, Part, BomItem | ||||||
| @@ -98,7 +99,7 @@ class PartCreate(AjaxCreateView): | |||||||
|         form = super(AjaxCreateView, self).get_form() |         form = super(AjaxCreateView, self).get_form() | ||||||
|  |  | ||||||
|         # Hide the default_supplier field (there are no matching supplier parts yet!) |         # Hide the default_supplier field (there are no matching supplier parts yet!) | ||||||
|         del form.fields['default_supplier'] |         form.fields['default_supplier'] = HiddenInput() | ||||||
|  |  | ||||||
|         return form |         return form | ||||||
|  |  | ||||||
| @@ -457,11 +458,11 @@ class SupplierPartCreate(AjaxCreateView): | |||||||
|          |          | ||||||
|         if form.initial.get('supplier', None): |         if form.initial.get('supplier', None): | ||||||
|             # Hide the supplier field |             # Hide the supplier field | ||||||
|             form.fields['supplier'].widget.attrs['disabled'] = True |             form.fields['supplier'].widget = HiddenInput() | ||||||
|  |  | ||||||
|         if form.initial.get('part', None): |         if form.initial.get('part', None): | ||||||
|             # Hide the part field |             # Hide the part field | ||||||
|             form.fields['part'].widget.attrs['disabled'] = True |             form.fields['part'].widget = HiddenInput() | ||||||
|  |  | ||||||
|         return form |         return form | ||||||
|  |  | ||||||
|   | |||||||
| @@ -7,6 +7,7 @@ from __future__ import unicode_literals | |||||||
|  |  | ||||||
| from django.views.generic import DetailView, ListView | from django.views.generic import DetailView, ListView | ||||||
| from django.forms.models import model_to_dict | from django.forms.models import model_to_dict | ||||||
|  | from django.forms import HiddenInput | ||||||
|  |  | ||||||
| from InvenTree.views import AjaxUpdateView, AjaxDeleteView, AjaxCreateView | from InvenTree.views import AjaxUpdateView, AjaxDeleteView, AjaxCreateView | ||||||
|  |  | ||||||
| @@ -141,6 +142,9 @@ class StockItemCreate(AjaxCreateView): | |||||||
|             parts = parts.filter(part=part) |             parts = parts.filter(part=part) | ||||||
|             form.fields['supplier_part'].queryset = parts |             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! |         # Otherwise if the user has selected a SupplierPart, we know what Part they meant! | ||||||
|         elif form['supplier_part'].value() is not None: |         elif form['supplier_part'].value() is not None: | ||||||
|             pass |             pass | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user