mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Added 'Pending' builds report to homepage, includes builds with 'Allocated' status
This commit is contained in:
parent
28a55f0a58
commit
3d597cc3c3
@ -59,7 +59,10 @@ class BuildList(generics.ListCreateAPIView):
|
||||
status = self.request.query_params.get('status', None)
|
||||
|
||||
if status is not None:
|
||||
queryset = queryset.filter(status=status)
|
||||
# Get status codes
|
||||
codes = status.split('-')
|
||||
# Filter by codes
|
||||
queryset = queryset.filter(status__in=codes)
|
||||
|
||||
# Filter by associated part?
|
||||
part = self.request.query_params.get('part', None)
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
{% block collapse_title %}
|
||||
<span class='fas fa-times-circle icon-header'></span>
|
||||
{% trans "BOM - Missing Validation" %}<span class='badge' id='bom-invalid-count'>0</span>
|
||||
{% trans "BOM Waiting Validation" %}<span class='badge' id='bom-invalid-count'>0</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block collapse_content %}
|
||||
|
15
InvenTree/templates/InvenTree/build_pending.html
Normal file
15
InvenTree/templates/InvenTree/build_pending.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "collapse_index.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block collapse_title %}
|
||||
<span class='fas fa-times-circle icon-header'></span>
|
||||
{% trans "Pending Builds" %}<span class='badge' id='build-pending-count'>0</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block collapse_content %}
|
||||
|
||||
<table class='table table-striped table-condensed' id='build-pending-table'>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
@ -10,7 +10,7 @@ InvenTree | Index
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{% include "InvenTree/latest_parts.html" with collapse_id="latest" %}
|
||||
{% include "InvenTree/latest_parts.html" with collapse_id="latest_parts" %}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{% include "InvenTree/bom_invalid.html" with collapse_id="bom_invalid" %}
|
||||
@ -26,6 +26,14 @@ InvenTree | Index
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{% include "InvenTree/build_pending.html" with collapse_id="build_pending" %}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_load %}
|
||||
@ -60,6 +68,14 @@ loadPartTable("#low-stock-table", "{% url 'api-part-list' %}", {
|
||||
}
|
||||
});
|
||||
|
||||
loadBuildTable("#build-pending-table", {
|
||||
url: "{% url 'api-build-list' %}",
|
||||
params: {
|
||||
"part_detail": true,
|
||||
"status": "10-20",
|
||||
}
|
||||
});
|
||||
|
||||
$("#bom-invalid-table").on('load-success.bs.table', function() {
|
||||
var count = $("#bom-invalid-table").bootstrapTable('getData').length;
|
||||
|
||||
@ -85,5 +101,11 @@ $("#low-stock-table").on('load-success.bs.table', function() {
|
||||
$("#low-stock-count").html(count);
|
||||
});
|
||||
|
||||
$("#build-pending-table").on('load-success.bs.table', function() {
|
||||
var count = $("#build-pending-table").bootstrapTable('getData').length;
|
||||
|
||||
$("#build-pending-count").html(count);
|
||||
});
|
||||
|
||||
|
||||
{% endblock %}
|
@ -1,4 +1,4 @@
|
||||
{% extends "collapse.html" %}
|
||||
{% extends "collapse_index.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "collapse.html" %}
|
||||
{% extends "collapse_index.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
|
@ -13,7 +13,7 @@ function loadBuildTable(table, options) {
|
||||
|
||||
setupFilterList("build", table);
|
||||
|
||||
table.inventreeTable({
|
||||
$(table).inventreeTable({
|
||||
method: 'get',
|
||||
formatNoMatches: function() {
|
||||
return "{% trans "No builds matching query" %}";
|
||||
|
Loading…
Reference in New Issue
Block a user