2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 20:46:47 +00:00

Bug fix for build order panel loading

This commit is contained in:
Oliver 2022-03-09 13:58:48 +11:00
parent 9f8f900e17
commit fe8ea5568f

View File

@ -396,10 +396,8 @@ function reloadTable() {
$('#allocation-table-untracked').bootstrapTable('refresh'); $('#allocation-table-untracked').bootstrapTable('refresh');
} }
onPanelLoad('allocate', function() { // Get the list of BOM items required for this build
inventreeGet(
// Get the list of BOM items required for this build
inventreeGet(
'{% url "api-bom-list" %}', '{% url "api-bom-list" %}',
{ {
part: {{ build.part.pk }}, part: {{ build.part.pk }},
@ -484,9 +482,9 @@ onPanelLoad('allocate', function() {
{% endif %} {% endif %}
} }
} }
); );
$('#btn-create-output').click(function() { $('#btn-create-output').click(function() {
createBuildOutput( createBuildOutput(
{{ build.pk }}, {{ build.pk }},
@ -494,11 +492,11 @@ onPanelLoad('allocate', function() {
trackable_parts: {% if build.part.has_trackable_parts %}true{% else %}false{% endif%}, trackable_parts: {% if build.part.has_trackable_parts %}true{% else %}false{% endif%},
} }
); );
}); });
{% if build.active %} {% if build.active %}
$("#btn-auto-allocate").on('click', function() { $("#btn-auto-allocate").on('click', function() {
autoAllocateStockToBuild( autoAllocateStockToBuild(
{{ build.pk }}, {{ build.pk }},
@ -509,9 +507,9 @@ onPanelLoad('allocate', function() {
{% endif %} {% endif %}
} }
); );
}); });
$("#btn-allocate").on('click', function() { $("#btn-allocate").on('click', function() {
var bom_items = $("#allocation-table-untracked").bootstrapTable("getData"); var bom_items = $("#allocation-table-untracked").bootstrapTable("getData");
@ -544,15 +542,15 @@ onPanelLoad('allocate', function() {
} }
); );
} }
}); });
$('#btn-unallocate').on('click', function() { $('#btn-unallocate').on('click', function() {
unallocateStock({{ build.id }}, { unallocateStock({{ build.id }}, {
table: '#allocation-table-untracked', table: '#allocation-table-untracked',
}); });
}); });
$('#allocate-selected-items').click(function() { $('#allocate-selected-items').click(function() {
var bom_items = $("#allocation-table-untracked").bootstrapTable("getSelections"); var bom_items = $("#allocation-table-untracked").bootstrapTable("getSelections");
@ -573,19 +571,18 @@ onPanelLoad('allocate', function() {
} }
} }
); );
}); });
$("#btn-order-parts").click(function() { $("#btn-order-parts").click(function() {
launchModalForm("/order/purchase-order/order-parts/", { launchModalForm("/order/purchase-order/order-parts/", {
data: { data: {
build: {{ build.id }}, build: {{ build.id }},
}, },
}); });
});
{% endif %}
}); });
{% endif %}
enableSidebar('buildorder'); enableSidebar('buildorder');
{% endblock %} {% endblock %}