2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

fix templates

This commit is contained in:
Matthias
2022-05-02 22:41:24 +02:00
parent 8f3899ffe6
commit e7b189ba29
8 changed files with 35 additions and 7 deletions

View File

@ -67,7 +67,7 @@
{% block thumbnail %}
<img class='part-thumb'
{% if order.supplier.image %}
{% if order.supplier and order.supplier.image %}
src="{{ order.supplier.image.url }}"
{% else %}
src="{% static 'img/blank_image.png' %}"
@ -110,7 +110,11 @@ src="{% static 'img/blank_image.png' %}"
<tr>
<td><span class='fas fa-building'></span></td>
<td>{% trans "Supplier" %}</td>
<td><a href="{% url 'company-detail' order.supplier.id %}">{{ order.supplier.name }}</a>{% include "clip.html"%}</td>
<td>
{% if order.supplier %}
<a href="{% url 'company-detail' order.supplier.id %}">{{ order.supplier.name }}</a>{% include "clip.html"%}
{% endif %}
</td>
</tr>
{% if order.supplier_reference %}
<tr>

View File

@ -32,6 +32,7 @@
<th colspan='2'>{% trans "Select Purchase Order" %}</th>
</tr>
{% for supplier in suppliers %}
{% if supplier %}
<tr id='suppier_row_{{ supplier.id }}'>
<td>
{% include 'hover_image.html' with image=supplier.image hover=False %}
@ -70,6 +71,7 @@
</div>
</td>
</tr>
{% endif %}
{% endfor %}
</table>

View File

@ -170,10 +170,12 @@ $('#new-po-line').click(function() {
var fields = poLineItemFields({
order: {{ order.pk }},
{% if order.supplier %}
supplier: {{ order.supplier.pk }},
{% if order.supplier.currency %}
currency: '{{ order.supplier.currency }}',
{% endif %}
{% endif %}
});
constructForm('{% url "api-po-line-list" %}', {
@ -210,7 +212,9 @@ $('#new-po-line').click(function() {
loadPurchaseOrderLineItemTable('#po-line-table', {
order: {{ order.pk }},
{% if order.supplier %}
supplier: {{ order.supplier.pk }},
{% endif %}
{% if roles.purchase_order.change %}
allow_edit: true,
{% else %}