mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #2729 from SchrodingersGat/build-allocation-load-speed
Bug fix for build order panel loading
This commit is contained in:
commit
927e206e14
@ -396,10 +396,8 @@ function reloadTable() {
|
||||
$('#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" %}',
|
||||
{
|
||||
part: {{ build.part.pk }},
|
||||
@ -484,9 +482,9 @@ onPanelLoad('allocate', function() {
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
$('#btn-create-output').click(function() {
|
||||
$('#btn-create-output').click(function() {
|
||||
|
||||
createBuildOutput(
|
||||
{{ build.pk }},
|
||||
@ -494,11 +492,11 @@ onPanelLoad('allocate', function() {
|
||||
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(
|
||||
{{ build.pk }},
|
||||
@ -509,9 +507,9 @@ onPanelLoad('allocate', function() {
|
||||
{% endif %}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn-allocate").on('click', function() {
|
||||
$("#btn-allocate").on('click', function() {
|
||||
|
||||
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 }}, {
|
||||
table: '#allocation-table-untracked',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#allocate-selected-items').click(function() {
|
||||
$('#allocate-selected-items').click(function() {
|
||||
|
||||
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/", {
|
||||
data: {
|
||||
build: {{ build.id }},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
{% endif %}
|
||||
});
|
||||
|
||||
{% endif %}
|
||||
|
||||
enableSidebar('buildorder');
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user