mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +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>{% progress_bar build.completed build.quantity id='build-completed-2' max_width='150px' %}</td>
|
||||
</tr>
|
||||
{% if build.active and build.has_untracked_bom_items %}
|
||||
{% if build.active and has_untracked_bom_items %}
|
||||
<tr>
|
||||
<td><span class='fas fa-list'></span></td>
|
||||
<td>{% trans "Allocated Parts" %}</td>
|
||||
@ -179,7 +179,7 @@
|
||||
<h4>{% trans "Allocate Stock to Build" %}</h4>
|
||||
{% include "spacer.html" %}
|
||||
<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" %}'>
|
||||
<span class='fas fa-minus-circle'></span> {% trans "Unallocate Stock" %}
|
||||
</button>
|
||||
@ -199,7 +199,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class='panel-content'>
|
||||
{% if build.has_untracked_bom_items %}
|
||||
{% if has_untracked_bom_items %}
|
||||
{% if build.active %}
|
||||
{% if build.are_untracked_parts_allocated %}
|
||||
<div class='alert alert-block alert-success'>
|
||||
@ -431,7 +431,7 @@ onPanelLoad('outputs', function() {
|
||||
{% endif %}
|
||||
});
|
||||
|
||||
{% if build.active and build.has_untracked_bom_items %}
|
||||
{% if build.active and has_untracked_bom_items %}
|
||||
|
||||
function loadUntrackedStockTable() {
|
||||
|
||||
|
@ -34,15 +34,11 @@ class BuildDetail(InvenTreeRoleMixin, InvenTreePluginViewMixin, DetailView):
|
||||
|
||||
build = self.get_object()
|
||||
|
||||
ctx['bom_price'] = build.part.get_price_info(build.quantity, buy=False)
|
||||
ctx['BuildStatus'] = BuildStatus
|
||||
ctx['sub_build_count'] = build.sub_build_count()
|
||||
|
||||
part = build.part
|
||||
bom_items = build.bom_items
|
||||
|
||||
ctx['part'] = part
|
||||
ctx['bom_items'] = bom_items
|
||||
ctx['has_tracked_bom_items'] = build.has_tracked_bom_items()
|
||||
ctx['has_untracked_bom_items'] = build.has_untracked_bom_items()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user