diff --git a/InvenTree/company/api.py b/InvenTree/company/api.py
index be44c7cf46..239d6064d3 100644
--- a/InvenTree/company/api.py
+++ b/InvenTree/company/api.py
@@ -193,7 +193,7 @@ class SupplierPartList(generics.ListCreateAPIView):
queryset = SupplierPart.objects.all().prefetch_related(
'part',
'supplier',
- 'manufacturer_part',
+ 'manufacturer_part__manufacturer',
)
def get_queryset(self):
@@ -291,9 +291,9 @@ class SupplierPartList(generics.ListCreateAPIView):
search_fields = [
'SKU',
'supplier__name',
- 'manufacturer__name',
+ 'manufacturer_part__manufacturer__name',
'description',
- 'MPN',
+ 'manufacturer_part__MPN',
'part__name',
'part__description',
]
diff --git a/InvenTree/company/templates/company/detail.html b/InvenTree/company/templates/company/detail.html
index 735f34f6b3..b803fc5852 100644
--- a/InvenTree/company/templates/company/detail.html
+++ b/InvenTree/company/templates/company/detail.html
@@ -51,12 +51,12 @@
- |
+ |
{% trans "Manufacturer" %} |
{% include "yesnolabel.html" with value=company.is_manufacturer %} |
- |
+ |
{% trans "Supplier" %} |
{% include 'yesnolabel.html' with value=company.is_supplier %} |
diff --git a/InvenTree/company/templates/company/manufacturer_part_navbar.html b/InvenTree/company/templates/company/manufacturer_part_navbar.html
index 07489d65ea..96b6bec699 100644
--- a/InvenTree/company/templates/company/manufacturer_part_navbar.html
+++ b/InvenTree/company/templates/company/manufacturer_part_navbar.html
@@ -10,7 +10,7 @@
-
+
{% trans "Suppliers" %}
diff --git a/InvenTree/company/templates/company/navbar.html b/InvenTree/company/templates/company/navbar.html
index 0e858d02bc..3010eb47fe 100644
--- a/InvenTree/company/templates/company/navbar.html
+++ b/InvenTree/company/templates/company/navbar.html
@@ -21,7 +21,7 @@
{% if manufacturer_parts.value == "True" and company.is_manufacturer %}
-
+
{% trans "Manufactured Parts" %}
@@ -29,7 +29,7 @@
{% if company.is_supplier or company.is_manufacturer %}
-
+
{% trans "Supplied Parts" %}
diff --git a/InvenTree/company/templates/company/supplier_part_manufacturers.html b/InvenTree/company/templates/company/supplier_part_manufacturers.html
new file mode 100644
index 0000000000..f2ce84b00b
--- /dev/null
+++ b/InvenTree/company/templates/company/supplier_part_manufacturers.html
@@ -0,0 +1,43 @@
+{% extends "company/supplier_part_base.html" %}
+{% load static %}
+{% load i18n %}
+{% load inventree_extras %}
+
+{% block menubar %}
+{% include "company/supplier_part_navbar.html" with tab='manufacturers' %}
+{% endblock %}
+
+{% block heading %}
+{% trans "Manufacturer Parts" %}
+{% endblock %}
+
+{% block details %}
+{% setting_object 'PART_ENABLE_MANUFACTURER_PARTS' as manufacturer_parts %}
+
+{% if manufacturer_parts.value == "True" %}
+
+{% else %}
+
+ {% trans "Manufactured parts are disabled. Admin users can enable them in the global settings." %}
+
+{% endif %}
+
+{% endblock %}
+
+{% block js_ready %}
+{{ block.super }}
+
+ loadManufacturerPartTable(
+ "#manufacturer-table",
+ "{% url 'api-manufacturer-part-list' %}",
+ {
+ params: {
+ part: {{ part.id }},
+ part_detail: true,
+ manufacturer_detail: true,
+ },
+ }
+ );
+
+{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/company/templates/company/supplier_part_navbar.html b/InvenTree/company/templates/company/supplier_part_navbar.html
index 4236e7b734..33b1a02f34 100644
--- a/InvenTree/company/templates/company/supplier_part_navbar.html
+++ b/InvenTree/company/templates/company/supplier_part_navbar.html
@@ -1,4 +1,5 @@
{% load i18n %}
+{% load inventree_extras %}
@@ -8,6 +9,16 @@
+ {% setting_object 'PART_ENABLE_MANUFACTURER_PARTS' as manufacturer_parts %}
+ {% if manufacturer_parts.value == "True" %}
+ -
+
+
+ {% trans "Manufacturers" %}
+
+
+ {% endif %}
+
-
diff --git a/InvenTree/company/urls.py b/InvenTree/company/urls.py
index 939515eabc..b87b0626ae 100644
--- a/InvenTree/company/urls.py
+++ b/InvenTree/company/urls.py
@@ -72,6 +72,7 @@ manufacturer_part_urls = [
supplier_part_detail_urls = [
url(r'^edit/?', views.SupplierPartEdit.as_view(), name='supplier-part-edit'),
+ url(r'^manufacturers/', views.SupplierPartDetail.as_view(template_name='company/supplier_part_manufacturers.html'), name='supplier-part-manufacturers'),
url(r'^pricing/', views.SupplierPartDetail.as_view(template_name='company/supplier_part_pricing.html'), name='supplier-part-pricing'),
url(r'^orders/', views.SupplierPartDetail.as_view(template_name='company/supplier_part_orders.html'), name='supplier-part-orders'),
url(r'^stock/', views.SupplierPartDetail.as_view(template_name='company/supplier_part_stock.html'), name='supplier-part-stock'),
diff --git a/InvenTree/part/templates/part/navbar.html b/InvenTree/part/templates/part/navbar.html
index 47ac221517..3f13f52621 100644
--- a/InvenTree/part/templates/part/navbar.html
+++ b/InvenTree/part/templates/part/navbar.html
@@ -73,14 +73,14 @@
{% if manufacturer_parts.value == "True" %}
-
-
+
{% trans "Manufacturers" %}
{% endif %}
-
-
+
{% trans "Suppliers" %}
diff --git a/InvenTree/templates/InvenTree/search.html b/InvenTree/templates/InvenTree/search.html
index 5eb755dcb2..81f02a9d64 100644
--- a/InvenTree/templates/InvenTree/search.html
+++ b/InvenTree/templates/InvenTree/search.html
@@ -2,6 +2,7 @@
{% load static %}
{% load i18n %}
+{% load inventree_extras %}
{% block page_title %}
InvenTree | {% trans "Search Results" %}
@@ -145,6 +146,24 @@ InvenTree | {% trans "Search Results" %}
],
});
+ {% setting_object 'PART_ENABLE_MANUFACTURER_PARTS' as manufacturer_parts %}
+ {% if manufacturer_parts.value == "True" %}
+ addItem('manufacturer-part', '{% trans "Manufacturer Parts" %}', 'fa-toolbox');
+
+ loadManufacturerPartTable(
+ "#table-manufacturer-part",
+ "{% url 'api-manufacturer-part-list' %}",
+ {
+ params: {
+ search: "{{ query }}",
+ part_detail: true,
+ supplier_detail: true,
+ manufacturer_detail: true
+ },
+ }
+ );
+ {% endif %}
+
addItem('supplier-part', '{% trans "Supplier Parts" %}', 'fa-pallet');
loadSupplierPartTable(
@@ -287,6 +306,15 @@ InvenTree | {% trans "Search Results" %}
{% if roles.purchase_order.view or roles.sales_order.view %}
addItemTitle('{% trans "Company" %}');
+ addItem('manufacturer', '{% trans "Manufacturers" %}', 'fa-industry');
+
+ loadCompanyTable('#table-manufacturer', "{% url 'api-company-list' %}", {
+ params: {
+ search: "{{ query }}",
+ is_manufacturer: "true",
+ }
+ });
+
{% if roles.purchase_order.view %}
addItem('supplier', '{% trans "Suppliers" %}', 'fa-building');
@@ -305,16 +333,6 @@ InvenTree | {% trans "Search Results" %}
}
});
- addItem('manufacturer', '{% trans "Manufacturers" %}', 'fa-industry');
-
- loadCompanyTable('#table-manufacturer', "{% url 'api-company-list' %}", {
- params: {
- search: "{{ query }}",
- is_manufacturer: "true",
- }
- });
-
-
{% endif %}
{% if roles.sales_order.view %}