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 %}