diff --git a/InvenTree/build/serializers.py b/InvenTree/build/serializers.py index dd4a568187..a7bb61a5cc 100644 --- a/InvenTree/build/serializers.py +++ b/InvenTree/build/serializers.py @@ -45,7 +45,7 @@ class BuildItemSerializer(InvenTreeModelSerializer): part = serializers.IntegerField(source='stock_item.part.pk', read_only=True) part_name = serializers.CharField(source='stock_item.part.full_name', read_only=True) - part_image = serializers.CharField(source='stock_item.part.image.url', read_only=True) + part_image = serializers.CharField(source='stock_item.part.image', read_only=True) stock_item_detail = StockItemSerializerBrief(source='stock_item', read_only=True) class Meta: diff --git a/InvenTree/build/templates/build/allocate.html b/InvenTree/build/templates/build/allocate.html index 3ad123da7f..3a024c8255 100644 --- a/InvenTree/build/templates/build/allocate.html +++ b/InvenTree/build/templates/build/allocate.html @@ -62,30 +62,7 @@ InvenTree | Allocate Parts {% else %} - $("#build-item-table").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', - }, - ] - }); + $("#build-list").bootstrapTable({}); $("#btn-allocate").click(function() { location.href = "{% url 'build-allocate' build.id %}?edit=1"; diff --git a/InvenTree/build/templates/build/allocate_edit.html b/InvenTree/build/templates/build/allocate_edit.html index 3040997fb9..d5978afa1d 100644 --- a/InvenTree/build/templates/build/allocate_edit.html +++ b/InvenTree/build/templates/build/allocate_edit.html @@ -1,6 +1,6 @@ -

Allocate Stock to Build

+

Allocate Stock to Build

diff --git a/InvenTree/build/templates/build/allocate_view.html b/InvenTree/build/templates/build/allocate_view.html index 9cef45bbbc..49ee5d71c4 100644 --- a/InvenTree/build/templates/build/allocate_view.html +++ b/InvenTree/build/templates/build/allocate_view.html @@ -1,4 +1,4 @@ -

Stock Allocated to Build

+

Required Parts

@@ -6,5 +6,28 @@
- +
+ + + + + + + + + + + {% for item in build.required_parts %} + + + + + + + + {% endfor %} +
PartDescriptionAvailableRequiredAllocated
+ {% include "hover_image.html" with image=item.part.image hover=True %} + {{ item.part.full_name }} + {{ item.part.description }}{{ item.part.total_stock }}{{ item.quantity }}{{ item.allocated }}
\ No newline at end of file diff --git a/InvenTree/build/templates/build/allocation_item.html b/InvenTree/build/templates/build/allocation_item.html index ebe05ce4d4..7339f7aff4 100644 --- a/InvenTree/build/templates/build/allocation_item.html +++ b/InvenTree/build/templates/build/allocation_item.html @@ -6,7 +6,7 @@ {% block collapse_panel_setup %}class='panel part-allocation' id='allocation-panel-{{ item.sub_part.id }}'{% endblock %} {% block collapse_title %} - {% include "hover_image.html" with image=item.sub_part.image %} + {% include "hover_image.html" with image=item.sub_part.image hover=false %}
{{ item.sub_part.full_name }} {{ item.sub_part.description }} @@ -15,7 +15,7 @@ {% block collapse_heading %}
- {{ item.sub_part.available_stock }} + {{ item.sub_part.total_stock }}
{% multiply build.quantity item.quantity %} diff --git a/InvenTree/build/templates/build/auto_allocate.html b/InvenTree/build/templates/build/auto_allocate.html index 72d328df9b..d278b9cd18 100644 --- a/InvenTree/build/templates/build/auto_allocate.html +++ b/InvenTree/build/templates/build/auto_allocate.html @@ -21,7 +21,7 @@ Automatically allocate stock to this build? {% for item in allocations %} - {% include "hover_image.html" with image=item.stock_item.part.image %} + {% include "hover_image.html" with image=item.stock_item.part.image hover=True %} {{ item.stock_item.part.full_name }}
diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html index 7cb5a2d659..b171f2c8aa 100644 --- a/InvenTree/build/templates/build/build_base.html +++ b/InvenTree/build/templates/build/build_base.html @@ -42,7 +42,7 @@ InvenTree | Build - {{ build }} {% if bom_price %} {{ bom_price }} {% if build.part.has_complete_bom_pricing == False %} - BOM pricing is incomplete +
BOM pricing is incomplete {% endif %} {% else %} No pricing information @@ -81,8 +81,6 @@ InvenTree | Build - {{ build }}
-{% include "modals.html" %} - {% endblock %} {% block js_ready %} diff --git a/InvenTree/build/templates/build/complete.html b/InvenTree/build/templates/build/complete.html index 0a8f094614..230092d766 100644 --- a/InvenTree/build/templates/build/complete.html +++ b/InvenTree/build/templates/build/complete.html @@ -18,7 +18,7 @@ The following items will be removed from stock: {% for item in taking %} - {% include "hover_image.html" with image=item.stock_item.part.image %} + {% include "hover_image.html" with image=item.stock_item.part.image hover=True %} {{ item.stock_item.part.full_name }}
@@ -35,7 +35,7 @@ No parts have been allocated to this build.
The following items will be created:
- {% include "hover_image.html" with image=build.part.image %} + {% include "hover_image.html" with image=build.part.image hover=True %} {{ build.quantity }} x {{ build.part.full_name }}
diff --git a/InvenTree/build/templates/build/index.html b/InvenTree/build/templates/build/index.html index d52bcb4c4a..3c9eda3544 100644 --- a/InvenTree/build/templates/build/index.html +++ b/InvenTree/build/templates/build/index.html @@ -29,8 +29,6 @@ InvenTree | Build List {% include "build/build_list.html" with builds=cancelled title="Cancelled Builds" completed=False collapse_id="cancelled" %} -{% include 'modals.html' %} - {% endblock %} {% block js_ready %} diff --git a/InvenTree/build/templates/build/required.html b/InvenTree/build/templates/build/required.html deleted file mode 100644 index 66aea7d48a..0000000000 --- a/InvenTree/build/templates/build/required.html +++ /dev/null @@ -1,41 +0,0 @@ -{% extends "build/build_base.html" %} -{% load static %} - -{% block details %} - -{% include "build/tabs.html" with tab='required' %} - -

Required Parts

- - - - - - - - - - - {% for item in build.required_parts %} - - - - - - - {% endfor %} - -
PartAvailableRequiredAllocated
- {% include "hover_image.html" with image=item.part.image %} - {{ item.part.full_name }} - {{ item.part.total_stock }}{{ item.quantity }}{{ item.allocated }}
- -{% endblock %} - -{% block js_ready %} - -{{ block.super }} - - $("#build-list").bootstrapTable({}); - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/tabs.html b/InvenTree/build/templates/build/tabs.html index c52309b132..2f27f11fc0 100644 --- a/InvenTree/build/templates/build/tabs.html +++ b/InvenTree/build/templates/build/tabs.html @@ -2,11 +2,8 @@ Details - - Required - - Allocate + Parts diff --git a/InvenTree/build/urls.py b/InvenTree/build/urls.py index 383e478494..3118bd6042 100644 --- a/InvenTree/build/urls.py +++ b/InvenTree/build/urls.py @@ -24,8 +24,6 @@ build_detail_urls = [ url(r'^auto-allocate/?', views.BuildAutoAllocate.as_view(), name='build-auto-allocate'), 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'), ] diff --git a/InvenTree/build/views.py b/InvenTree/build/views.py index e325d3cc5b..ace53ecca6 100644 --- a/InvenTree/build/views.py +++ b/InvenTree/build/views.py @@ -294,6 +294,8 @@ class BuildAllocate(DetailView): context['part'] = part 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)): context['editing'] = True diff --git a/InvenTree/company/templates/company/company_base.html b/InvenTree/company/templates/company/company_base.html index 8c64190865..6de8d83bbb 100644 --- a/InvenTree/company/templates/company/company_base.html +++ b/InvenTree/company/templates/company/company_base.html @@ -68,8 +68,6 @@ InvenTree | Company - {{ company.name }}
-{% include 'modals.html' %} - {% endblock %} {% block js_load %} diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html index 54a9d53213..84fd85732e 100644 --- a/InvenTree/company/templates/company/index.html +++ b/InvenTree/company/templates/company/index.html @@ -26,10 +26,6 @@ InvenTree | Supplier List
- - -{% include 'modals.html' %} - {% endblock %} {% block js_ready %} {{ block.super }} diff --git a/InvenTree/company/templates/company/partdetail.html b/InvenTree/company/templates/company/partdetail.html index ab4a369469..dd43d0c5e4 100644 --- a/InvenTree/company/templates/company/partdetail.html +++ b/InvenTree/company/templates/company/partdetail.html @@ -103,10 +103,6 @@ InvenTree | {{ company.name }} - Parts
- - -{% include 'modals.html' %} - {% endblock %} {% block js_ready %} diff --git a/InvenTree/part/templates/part/part_base.html b/InvenTree/part/templates/part/part_base.html index 1354a9a4a4..9c68cfe69f 100644 --- a/InvenTree/part/templates/part/part_base.html +++ b/InvenTree/part/templates/part/part_base.html @@ -109,8 +109,6 @@ {% endblock %}
-{% include 'modals.html' %} - {% endblock %} {% block js_ready %} diff --git a/InvenTree/part/templates/part/variants.html b/InvenTree/part/templates/part/variants.html index 8061e32e7a..d2114a050c 100644 --- a/InvenTree/part/templates/part/variants.html +++ b/InvenTree/part/templates/part/variants.html @@ -33,7 +33,7 @@ {% for variant in part.variants.all %} - {% include "hover_image.html" with image=variant.image %} + {% include "hover_image.html" with image=variant.image hover=True %} {{ variant.full_name }} {{ variant.description }} diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html index b165eaa72a..987d433104 100644 --- a/InvenTree/stock/templates/stock/location.html +++ b/InvenTree/stock/templates/stock/location.html @@ -46,8 +46,6 @@ {% include "stock_table.html" %} -{% include 'modals.html' %} - {% endblock %} {% block js_load %} diff --git a/InvenTree/stock/templates/stock/stock_adjust.html b/InvenTree/stock/templates/stock/stock_adjust.html index 9bd4203725..625cb3c3af 100644 --- a/InvenTree/stock/templates/stock/stock_adjust.html +++ b/InvenTree/stock/templates/stock/stock_adjust.html @@ -17,7 +17,7 @@ {% for item in stock_items %} - {% include "hover_image.html" with image=item.part.image %} + {% include "hover_image.html" with image=item.part.image hover=True %} {{ item.part.full_name }} {{ item.part.description }} {{ item.location.pathstring }} diff --git a/InvenTree/stock/templates/stock/tracking.html b/InvenTree/stock/templates/stock/tracking.html index 9ba4b290df..ecd9772897 100644 --- a/InvenTree/stock/templates/stock/tracking.html +++ b/InvenTree/stock/templates/stock/tracking.html @@ -8,8 +8,6 @@
-{% include 'modals.html' %} - {% endblock %} {% block js_ready %} diff --git a/InvenTree/templates/hover_image.html b/InvenTree/templates/hover_image.html index 0853c4fc12..4ee9f67b2c 100644 --- a/InvenTree/templates/hover_image.html +++ b/InvenTree/templates/hover_image.html @@ -1,12 +1,12 @@ {% load static %} -
- {% if image %} + \ No newline at end of file