{% extends "stock/stock_app_base.html" %} {% load static %} {% block content %}
{% if location %}

{{ location.name }}

{{ location.description }}

{% else %}

Stock

All stock items

{% endif %}

{% if location %} {% include "qr_button.html" %} {% endif %}

{% if location %}

Location Details

Location Path {{ location.pathstring }}
Location Description {{ location.description }}
Sublocations {{ location.children.count }}
Stock Items {{ location.item_count }}
{% endif %}
{% if location and location.children.all|length > 0 %} {% include 'stock/location_list.html' with children=location.children.all collapse_id="locations" %} {% elif locations|length > 0 %} {% include 'stock/location_list.html' with children=locations collapse_id="locations" %} {% endif %}
{% include "stock_table.html" %} {% endblock %} {% block js_load %} {{ block.super }} {% endblock %} {% block js_ready %} {{ block.super }} if (inventreeLoadInt("show-part-locs") == 1) { $("#collapse-item-locations").collapse('show'); } $("#collapse-item-locations").on('shown.bs.collapse', function() { inventreeSave('show-part-locs', 1); }); $("#collapse-item-locations").on('hidden.bs.collapse', function() { inventreeDel('show-part-locs'); }); $("#stock-export").click(function() { launchModalForm("{% url 'stock-export-options' %}", { submit_text: "Export", success: function(response) { var url = "{% url 'stock-export' %}"; url += "?format=" + response.format; url += "&cascade=" + response.cascade; {% if location %} url += "&location={{ location.id }}"; {% endif %} location.href = url; } }); }); $('#location-create').click(function () { launchModalForm("{% url 'stock-location-create' %}", { data: { {% if location %} location: {{ location.id }} {% endif %} }, follow: true, secondary: [ { field: 'parent', label: 'New Location', title: 'Create new location', url: "{% url 'stock-location-create' %}", }, ] }); return false; }); {% if location %} $('#location-edit').click(function() { launchModalForm("{% url 'stock-location-edit' location.id %}", { reload: true }); return false; }); $('#location-delete').click(function() { launchModalForm("{% url 'stock-location-delete' location.id %}", { redirect: "{% url 'stock-index' %}" }); return false; }); {% if location %} $("#location-count").click(function() { launchModalForm("/stock/adjust/", { data: { action: "count", location: {{ location.id }}, reload: true, } }); }); {% endif %} $('#show-qr-code').click(function() { launchModalForm("{% url 'stock-location-qr' location.id %}", { no_post: true, }); }); {% endif %} $('#item-create').click(function () { launchModalForm("{% url 'stock-item-create' %}", { success: function() { $("#stock-table").bootstrapTable('refresh'); }, data: { {% if location %} location: {{ location.id }} {% endif %} }, secondary: [ { field: 'part', label: 'New Part', title: 'Create New Part', url: "{% url 'part-create' %}", }, { field: 'supplier_part', label: 'New Supplier Part', title: 'Create new Supplier Part', url: "{% url 'supplier-part-create' %}" }, { field: 'location', label: 'New Location', title: 'Create New Location', url: "{% url 'stock-location-create' %}", } ] }); return false; }); loadStockTable($("#stock-table"), { buttons: [ '#stock-options', ], params: { {% if location %} location: {{ location.id }}, {% endif %} part_detail: true, location_detail: true, }, url: "{% url 'api-stock-list' %}", }); {% endblock %}