{% extends "stock/stock_app_base.html" %} {% load static %} {% load inventree_extras %} {% load i18n %} {% block menubar %} {% include "stock/location_navbar.html" with tab="stock" %} {% endblock %} {% block content %}
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %} {% if owner_control.value == "True" %} {% authorized_owners location.owner as owners %} {% if location and not user in owners and not user.is_superuser %}
{% trans "You are not in the list of owners of this location. This stock location cannot be edited." %}
{% endif %} {% endif %}
{% if location %}

{{ location.name }} {% if user.is_staff and roles.stock_location.change %} {% endif %}

{{ location.description }}

{% else %}

{% trans "Stock" %}

{% trans "All stock items" %}

{% endif %}
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser or not location %} {% if roles.stock_location.add %} {% endif %} {% endif %} {% if barcodes %} {% if location %} {% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser %} {% if roles.stock.change %} {% endif %} {% if roles.stock_location.change %}
{% endif %} {% endif %} {% endif %} {% endif %}
{% if location %}

{% trans "Location Details" %}

{% trans "Location Path" %} {{ location.pathstring }}
{% trans "Location Description" %} {{ location.description }}
{% trans "Sublocations" %} {{ location.children.count }}
{% trans "Stock Items" %} {{ location.item_count }}
{% else %}

{% trans "Stock Details" %}

{% trans "Stock Locations" %} {{ loc_count }}
{% trans "Stock Items" %} {{ stock_count }}
{% endif %}
{% block location_content %}

{% trans "Stock Items" %}

{% include "stock_table.html" %}
{% endblock %} {% endblock %} {% block js_ready %} {{ block.super }} enableNavbar({ label: 'location', toggleId: '#location-menu-toggle' }); {% if location %} $("#barcode-check-in").click(function() { barcodeCheckIn({{ location.id }}); }); {% endif %} $("#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; {% 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: '{% trans "New Location" %}', title: '{% trans "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, } }); }); $('#print-label').click(function() { var locs = [{{ location.pk }}]; printStockLocationLabels(locs); }); {% endif %} $('#show-qr-code').click(function() { launchModalForm("{% url 'stock-location-qr' location.id %}", { no_post: true, }); }); {% endif %} $('#item-create').click(function () { createNewStockItem({ follow: true, data: { {% if location %} location: {{ location.id }} {% endif %} } }); }); loadStockTable($("#stock-table"), { buttons: [ '#stock-options', ], params: { {% if location %} location: {{ location.pk }}, {% endif %} part_detail: true, location_detail: true, supplier_part_detail: true, }, url: "{% url 'api-stock-list' %}", }); {% endblock %}