mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 21:16:46 +00:00
Improve rendering efficiency for build detail page (#4416)
- Remove pre-calculated context data (which is not used)
This commit is contained in:
parent
5037e427b6
commit
b6b701b077
@ -67,7 +67,7 @@
|
|||||||
<td>{% trans "Completed" %}</td>
|
<td>{% trans "Completed" %}</td>
|
||||||
<td>{% progress_bar build.completed build.quantity id='build-completed-2' max_width='150px' %}</td>
|
<td>{% progress_bar build.completed build.quantity id='build-completed-2' max_width='150px' %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if build.active and build.has_untracked_bom_items %}
|
{% if build.active and has_untracked_bom_items %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-list'></span></td>
|
<td><span class='fas fa-list'></span></td>
|
||||||
<td>{% trans "Allocated Parts" %}</td>
|
<td>{% trans "Allocated Parts" %}</td>
|
||||||
@ -179,7 +179,7 @@
|
|||||||
<h4>{% trans "Allocate Stock to Build" %}</h4>
|
<h4>{% trans "Allocate Stock to Build" %}</h4>
|
||||||
{% include "spacer.html" %}
|
{% include "spacer.html" %}
|
||||||
<div class='btn-group' role='group'>
|
<div class='btn-group' role='group'>
|
||||||
{% if roles.build.add and build.active and build.has_untracked_bom_items %}
|
{% if roles.build.add and build.active and has_untracked_bom_items %}
|
||||||
<button class='btn btn-danger' type='button' id='btn-unallocate' title='{% trans "Unallocate stock" %}'>
|
<button class='btn btn-danger' type='button' id='btn-unallocate' title='{% trans "Unallocate stock" %}'>
|
||||||
<span class='fas fa-minus-circle'></span> {% trans "Unallocate Stock" %}
|
<span class='fas fa-minus-circle'></span> {% trans "Unallocate Stock" %}
|
||||||
</button>
|
</button>
|
||||||
@ -199,7 +199,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='panel-content'>
|
<div class='panel-content'>
|
||||||
{% if build.has_untracked_bom_items %}
|
{% if has_untracked_bom_items %}
|
||||||
{% if build.active %}
|
{% if build.active %}
|
||||||
{% if build.are_untracked_parts_allocated %}
|
{% if build.are_untracked_parts_allocated %}
|
||||||
<div class='alert alert-block alert-success'>
|
<div class='alert alert-block alert-success'>
|
||||||
@ -431,7 +431,7 @@ onPanelLoad('outputs', function() {
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
});
|
});
|
||||||
|
|
||||||
{% if build.active and build.has_untracked_bom_items %}
|
{% if build.active and has_untracked_bom_items %}
|
||||||
|
|
||||||
function loadUntrackedStockTable() {
|
function loadUntrackedStockTable() {
|
||||||
|
|
||||||
|
@ -34,15 +34,11 @@ class BuildDetail(InvenTreeRoleMixin, InvenTreePluginViewMixin, DetailView):
|
|||||||
|
|
||||||
build = self.get_object()
|
build = self.get_object()
|
||||||
|
|
||||||
ctx['bom_price'] = build.part.get_price_info(build.quantity, buy=False)
|
|
||||||
ctx['BuildStatus'] = BuildStatus
|
ctx['BuildStatus'] = BuildStatus
|
||||||
ctx['sub_build_count'] = build.sub_build_count()
|
|
||||||
|
|
||||||
part = build.part
|
part = build.part
|
||||||
bom_items = build.bom_items
|
|
||||||
|
|
||||||
ctx['part'] = part
|
ctx['part'] = part
|
||||||
ctx['bom_items'] = bom_items
|
|
||||||
ctx['has_tracked_bom_items'] = build.has_tracked_bom_items()
|
ctx['has_tracked_bom_items'] = build.has_tracked_bom_items()
|
||||||
ctx['has_untracked_bom_items'] = build.has_untracked_bom_items()
|
ctx['has_untracked_bom_items'] = build.has_untracked_bom_items()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user