mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Render better build description in complete form
- List of items to be removed from stock - Detail of what will be created
This commit is contained in:
parent
905d78e25c
commit
a4aec425be
@ -4,10 +4,21 @@
|
|||||||
<b>Build: {{ build.title }}</b> - {{ build.quantity }} x {{ build.part.name }}
|
<b>Build: {{ build.title }}</b> - {{ build.quantity }} x {{ build.part.name }}
|
||||||
<br>
|
<br>
|
||||||
Are you sure you want to mark this build as complete?
|
Are you sure you want to mark this build as complete?
|
||||||
<br>
|
<hr>
|
||||||
Completing the build will perform the following actions:
|
{% if taking %}
|
||||||
|
The following items will be removed from stock:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Remove allocated parts from stock</li>
|
{% for item in taking %}
|
||||||
<li>Create {{ build.quantity }} new items in the selected location</li>
|
<li>{{ item.quantity }} x {{ item.stock_item.part.name }} from {{ item.stock_item.location }}</li>
|
||||||
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
No parts have been allocated to this build.
|
||||||
|
{% endif %}
|
||||||
|
<hr>
|
||||||
|
The following items will be created:
|
||||||
|
<ul>
|
||||||
|
<li>{{ build.quantity }} x {{ build.part.name }}</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -95,6 +95,7 @@ class BuildComplete(AjaxUpdateView):
|
|||||||
if build.part.default_location is not None:
|
if build.part.default_location is not None:
|
||||||
try:
|
try:
|
||||||
location = StockLocation.objects.get(pk=build.part.default_location.id)
|
location = StockLocation.objects.get(pk=build.part.default_location.id)
|
||||||
|
initials['location'] = location
|
||||||
except StockLocation.DoesNotExist:
|
except StockLocation.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -106,8 +107,15 @@ class BuildComplete(AjaxUpdateView):
|
|||||||
- Build information is required
|
- Build information is required
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
build = self.get_object()
|
||||||
|
|
||||||
|
# Build object
|
||||||
context = super(BuildComplete, self).get_context_data(**kwargs).copy()
|
context = super(BuildComplete, self).get_context_data(**kwargs).copy()
|
||||||
context['build'] = self.get_object()
|
context['build'] = build
|
||||||
|
|
||||||
|
# Items to be removed from stock
|
||||||
|
taking = BuildItem.objects.filter(build=build.id)
|
||||||
|
context['taking'] = taking
|
||||||
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user