mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Simplified build allocation view
This commit is contained in:
parent
7a3b186a0c
commit
68e4adda48
@ -62,30 +62,7 @@ InvenTree | Allocate Parts
|
|||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
$("#build-item-table").bootstrapTable({
|
$("#build-list").bootstrapTable({});
|
||||||
url: "{% url 'api-build-item-list' %}",
|
|
||||||
queryParams: {
|
|
||||||
build: {{ build.id }},
|
|
||||||
},
|
|
||||||
search: true,
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
field: 'part_name',
|
|
||||||
title: 'Part',
|
|
||||||
formatter: function(value, row, index, field) {
|
|
||||||
return imageHoverIcon(row.part_image) + value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'stock_item_detail.location_name',
|
|
||||||
title: 'Location',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'quantity',
|
|
||||||
title: 'Quantity Allocated',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#btn-allocate").click(function() {
|
$("#btn-allocate").click(function() {
|
||||||
location.href = "{% url 'build-allocate' build.id %}?edit=1";
|
location.href = "{% url 'build-allocate' build.id %}?edit=1";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<h4>Allocate Stock to Build</h4>
|
|
||||||
|
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
|
<h4>Allocate Stock to Build</h4>
|
||||||
<div class='col-sm-6'>
|
<div class='col-sm-6'>
|
||||||
</div>
|
</div>
|
||||||
<div class='col-sm-6'>
|
<div class='col-sm-6'>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<h4>Stock Allocated to Build</h4>
|
<h4>Required Parts</h4>
|
||||||
|
|
||||||
<div id='#build-item-toolbar'>
|
<div id='#build-item-toolbar'>
|
||||||
<div class='btn-group'>
|
<div class='btn-group'>
|
||||||
@ -6,5 +6,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class='table table-condensed table-striped' id='build-item-table' data-toolbar='#build-item-toolbar'>
|
<table class='table table-striped table-condensed' id='build-list' data-sorting='true' data-toolbar='#build-item-toolbar'>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Part</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Available</th>
|
||||||
|
<th>Required</th>
|
||||||
|
<th>Allocated</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for item in build.required_parts %}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{% include "hover_image.html" with image=item.part.image %}
|
||||||
|
<a class='hover-icon'a href="{% url 'part-detail' item.part.id %}">{{ item.part.full_name }}</a>
|
||||||
|
</td>
|
||||||
|
<td>{{ item.part.description }}</td>
|
||||||
|
<td>{{ item.part.total_stock }}</td>
|
||||||
|
<td>{{ item.quantity }}</td>
|
||||||
|
<td>{{ item.allocated }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
@ -42,7 +42,7 @@ InvenTree | Build - {{ build }}
|
|||||||
{% if bom_price %}
|
{% if bom_price %}
|
||||||
{{ bom_price }}
|
{{ bom_price }}
|
||||||
{% if build.part.has_complete_bom_pricing == False %}
|
{% if build.part.has_complete_bom_pricing == False %}
|
||||||
<span class='warning-msg'><i>BOM pricing is incomplete</i></span>
|
<br><span class='warning-msg'><i>BOM pricing is incomplete</i></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class='warning-msg'><i>No pricing information</i></span>
|
<span class='warning-msg'><i>No pricing information</i></span>
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
{% extends "build/build_base.html" %}
|
|
||||||
{% load static %}
|
|
||||||
|
|
||||||
{% block details %}
|
|
||||||
|
|
||||||
{% include "build/tabs.html" with tab='required' %}
|
|
||||||
|
|
||||||
<h4>Required Parts</h4>
|
|
||||||
<table class='table table-striped table-condensed' id='build-list' data-sorting='true'>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Part</th>
|
|
||||||
<th>Available</th>
|
|
||||||
<th>Required</th>
|
|
||||||
<th>Allocated</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for item in build.required_parts %}
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{% include "hover_image.html" with image=item.part.image %}
|
|
||||||
<a class='hover-icon'a href="{% url 'part-detail' item.part.id %}">{{ item.part.full_name }}</a>
|
|
||||||
</td>
|
|
||||||
<td>{{ item.part.total_stock }}</td>
|
|
||||||
<td>{{ item.quantity }}</td>
|
|
||||||
<td>{{ item.allocated }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block js_ready %}
|
|
||||||
|
|
||||||
{{ block.super }}
|
|
||||||
|
|
||||||
$("#build-list").bootstrapTable({});
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@ -2,9 +2,6 @@
|
|||||||
<li{% if tab == 'details' %} class='active'{% endif %}>
|
<li{% if tab == 'details' %} class='active'{% endif %}>
|
||||||
<a href="{% url 'build-detail' build.id %}">Details</a>
|
<a href="{% url 'build-detail' build.id %}">Details</a>
|
||||||
</li>
|
</li>
|
||||||
<li{% if tab == 'required' %} class='active'{% endif %}>
|
|
||||||
<a href="{% url 'build-required' build.id %}">Required</a>
|
|
||||||
</li>
|
|
||||||
<li{% if tab == 'allocate' %} class='active'{% endif %}>
|
<li{% if tab == 'allocate' %} class='active'{% endif %}>
|
||||||
<a href="{% url 'build-allocate' build.id %}">Allocate</a>
|
<a href="{% url 'build-allocate' build.id %}">Allocate</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -24,8 +24,6 @@ build_detail_urls = [
|
|||||||
url(r'^auto-allocate/?', views.BuildAutoAllocate.as_view(), name='build-auto-allocate'),
|
url(r'^auto-allocate/?', views.BuildAutoAllocate.as_view(), name='build-auto-allocate'),
|
||||||
url(r'^unallocate/', views.BuildUnallocate.as_view(), name='build-unallocate'),
|
url(r'^unallocate/', views.BuildUnallocate.as_view(), name='build-unallocate'),
|
||||||
|
|
||||||
url(r'^required/', views.BuildDetail.as_view(template_name='build/required.html'), name='build-required'),
|
|
||||||
|
|
||||||
url(r'^.*$', views.BuildDetail.as_view(), name='build-detail'),
|
url(r'^.*$', views.BuildDetail.as_view(), name='build-detail'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -294,6 +294,8 @@ class BuildAllocate(DetailView):
|
|||||||
context['part'] = part
|
context['part'] = part
|
||||||
context['bom_items'] = bom_items
|
context['bom_items'] = bom_items
|
||||||
|
|
||||||
|
context['bom_price'] = build.part.get_price_info(build.quantity, buy=False)
|
||||||
|
|
||||||
if str2bool(self.request.GET.get('edit', None)):
|
if str2bool(self.request.GET.get('edit', None)):
|
||||||
context['editing'] = True
|
context['editing'] = True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user