{% extends "part/part_base.html" %} {% load static %} {% load i18n %} {% block menubar %} {% include 'part/navbar.html' with tab='stock' %} {% endblock %} {% block heading %} {% trans "Part Stock" %} {% endblock %} {% block details %} {% if part.is_template %}
{% blocktrans with full_name=part.full_name%}Showing stock for all variants of {{full_name}}{% endblocktrans %}
{% endif %} {% include "stock_table.html" %} {% endblock %} {% block js_load %} {{ block.super }} {% endblock %} {% block js_ready %} {{ block.super }} $('#add-stock-item').click(function () { createNewStockItem({ reload: true, data: { part: {{ part.id }}, } }); }); loadStockTable($("#stock-table"), { params: { part: {{ part.id }}, location_detail: true, part_detail: false, supplier_part_detail: true, }, groupByField: 'location', buttons: [ '#stock-options', ], url: "{% url 'api-stock-list' %}", }); $("#stock-export").click(function() { launchModalForm("{% url 'stock-export-options' %}", { submit_text: "{% trans 'Export' %}", success: function(response) { var url = "{% url 'stock-export' %}"; url += "?format=" + response.format; url += "&cascade=" + response.cascade; url += "&part={{ part.id }}"; location.href = url; }, }); }); $('#item-create').click(function () { createNewStockItem({ reload: true, data: { part: {{ part.id }}, } }); }); {% endblock %}