{% extends "page_base.html" %} {% load static %} {% load i18n %} {% load inventree_extras %} {% block page_title %} {% inventree_title %} | {% trans "Manufacturer Part" %} {% endblock page_title %} {% block sidebar %} {% include "company/manufacturer_part_sidebar.html" %} {% endblock sidebar %} {% block breadcrumbs %} {% if part.manufacturer %} {% endif %} {% endblock breadcrumbs %} {% block heading %}

{% trans "Manufacturer Part" %}: {{ part.part.full_name }}

{% endblock heading %} {% block actions %} {% admin_url user 'company.manufacturerpart' part.pk as url %} {% include "admin_button.html" with url=url %} {% if roles.purchase_order.change %} {% if roles.purchase_order.add and part.part.purchaseable %} {% endif %} {% if roles.purchase_order.delete %} {% endif %} {% endif %} {% endblock actions %} {% block thumbnail %} {% trans 'Part image' %} {% endblock thumbnail %} {% block details %} {% if part.description %} {% endif %}
{% trans "Internal Part" %} {% if part.part %} {{ part.part.full_name }}{% include "clip.html" %} {% endif %}
{% trans "Description" %} {{ part.description }}{% include "clip.html" %}
{% endblock details %} {% block details_right %} {% if part.link %} {% endif %}
{% trans "Manufacturer" %} {% if part.manufacturer %} {{ part.manufacturer.name }}{% include "clip.html" %} {% else %} {% trans "No manufacturer information available" %} {% endif %}
{% trans "MPN" %} {{ part.MPN }}{% include "clip.html" %}
{% trans "External Link" %} {% include 'clip_link.html' with link=part.link new_window=True %}
{% endblock details_right %} {% block page_content %}

{% trans "Suppliers" %}

{% include "spacer.html" %}
{% include "filter_list.html" with id='supplier-part' %}

{% trans "Attachments" %}

{% include "spacer.html" %}
{% include "attachment_button.html" %}
{% include "attachment_table.html" %}

{% trans "Parameters" %}

{% include "spacer.html" %}
{% include "filter_list.html" with id="manufacturer-part-parameters" %}

{% trans "Manufacturer Part Notes" %}

{% include "spacer.html" %}
{% include "notes_buttons.html" %}
{% endblock page_content %} {% block js_ready %} {{ block.super }} // Load the "notes" tab onPanelLoad('manufacturer-part-notes', function() { setupNotesField( 'manufacturer-part-notes', '{% url "api-manufacturer-part-detail" part.pk %}', { model_type: "manufacturerpart", model_id: {{ part.pk }}, editable: {% js_bool roles.purchase_order.change %}, } ); }); onPanelLoad("attachments", function() { loadAttachmentTable('manufacturerpart', {{ part.pk }}); }); $('#parameter-create').click(function() { constructForm('{% url "api-manufacturer-part-parameter-list" %}', { method: 'POST', fields: { name: {}, value: {}, units: {}, manufacturer_part: { value: {{ part.pk }}, hidden: true, } }, title: '{% trans "Add Parameter" escape %}', refreshTable: '#parameter-table', }); }); function reloadSupplierPartTable() { $('#supplier-table').bootstrapTable('refresh'); } $('#supplier-create').click(function () { createSupplierPart({ manufacturer_part: {{ part.pk }}, part: {{ part.part.pk }}, onSuccess: reloadSupplierPartTable, }); }); loadSupplierPartTable( "#supplier-table", "{% url 'api-supplier-part-list' %}", { params: { part: {{ part.part.id }}, manufacturer_part: {{ part.id }}, part_detail: true, supplier_detail: true, manufacturer_detail: true, }, } ); loadManufacturerPartParameterTable( "#parameter-table", "{% url 'api-manufacturer-part-parameter-list' %}", { params: { manufacturer_part: {{ part.id }}, } } ); $('#order-part, #order-part2').click(function() { inventreeGet( '{% url "api-part-detail" part.part.pk %}', {}, { success: function(response) { orderParts([response], { manufacturer_part: {{ part.pk }}, {% if part.manufacturer %} manufacturer: {{ part.manufacturer.pk }}, {% endif %} }); } } ); }); $('#edit-part').click(function () { editManufacturerPart({{ part.pk }}, { onSuccess: function() { location.reload(); } }); }); $('#delete-part').click(function() { inventreeGet( '{% url "api-manufacturer-part-detail" part.pk %}', {}, { success: function(data) { deleteManufacturerParts( [data], { success: function() { {% if part.manufacturer %} window.location.href = "{% url 'company-detail' part.manufacturer.id %}"; {% else %} window.location.href = "{% url 'index' %}"; {% endif %} } } ); } } ); }); enableSidebar('manufacturerpart'); {% endblock js_ready %}