- {% trans "This Build Order is allocated to Sales Order" %} {{ build.sales_order }}
+ {% object_link 'so-detail' build.sales_order.id build.sales_order as link %}
+ {% blocktrans %}This Build Order is allocated to Sales Order {{ link }}{% endblocktrans %}
{% endif %}
{% if build.parent %}
- {% trans "This Build Order is a child of Build Order" %} {{ build.parent }}
+ {% object_link 'build-detail' build.parent.id build.parent as link %}
+ {% blocktrans %}This Build Order is a child of Build Order {{ link }}{% endblocktrans %}
- {% trans "This part is a variant of" %} {{ part.variant_of.full_name }}
+ {% object_link 'part-variants' part.variant_of.id part.variant_of.full_name as link %}
+ {% blocktrans %}This part is a variant of {{ link }}{% endblocktrans %}
{% endif %}
diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py
index c0dc15c2b0..8366b37f23 100644
--- a/InvenTree/part/templatetags/inventree_extras.py
+++ b/InvenTree/part/templatetags/inventree_extras.py
@@ -4,6 +4,8 @@ over and above the built-in Django tags.
import os
from django import template
+from django.urls import reverse
+from django.utils.safestring import mark_safe
from InvenTree import version, settings
import InvenTree.helpers
@@ -164,3 +166,11 @@ def authorized_owners(group):
pass
return owners
+
+
+@register.simple_tag()
+def object_link(url_name, pk, ref):
+ """ Return highlighted link to object """
+
+ ref_url = reverse(url_name, kwargs={'pk': pk})
+ return mark_safe('{}'.format(ref_url, ref))
diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html
index b955acda9c..23397c9886 100644
--- a/InvenTree/stock/templates/stock/item_base.html
+++ b/InvenTree/stock/templates/stock/item_base.html
@@ -48,13 +48,17 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
{% for allocation in item.sales_order_allocations.all %}
- {% trans "This stock item is allocated to Sales Order" %} #{{ allocation.line.order }} ({% trans "Quantity" %}: {% decimal allocation.quantity %})
+ {% object_link 'so-detail' allocation.line.order.id allocation.line.order as link %}
+ {% define decimal allocation.quantity as qty %}
+ {% blocktrans %}This stock item is allocated to Sales Order {{ link }} (Quantity: {{ qty }}){% endblocktrans %}
{% endfor %}
{% for allocation in item.allocations.all %}
- {% trans "This stock item is allocated to Build" %} #{{ allocation.build }} ({% trans "Quantity" %}: {% decimal allocation.quantity %})
+ {% object_link 'build-detail' allocation.build.id allocation.build %}
+ {% define decimal allocation.quantity as qty %}
+ {% blocktrans %}This stock item is allocated to Build {{ link }} (Quantity: {{ qty }}){% endblocktrans %}
{{ build.target_date }}
{% if build.is_overdue %}
- {% trans "Overdue" %}
+ {% trans "Overdue" %}
{% endif %}
diff --git a/InvenTree/build/templates/build/create_build_item.html b/InvenTree/build/templates/build/create_build_item.html
index 8f58e884d6..1a7934b88b 100644
--- a/InvenTree/build/templates/build/create_build_item.html
+++ b/InvenTree/build/templates/build/create_build_item.html
@@ -8,15 +8,13 @@
{% if output %}
- {% trans "The allocated stock will be installed into the following build output:" %}
-
- {{ output }}
+ {% blocktrans %}The allocated stock will be installed into the following build output: {{ output }}{% endblocktrans %}
{% endif %}
{% if no_stock %}
- {% trans "No stock available for" %} {{ part }}
+ {% blocktrans %}No stock available for {{ part }}{% endblocktrans %}
{% endif %}
{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/company/templates/company/manufacturer_part_delete.html b/InvenTree/company/templates/company/manufacturer_part_delete.html
index 4d5c2f6c86..98b55934d0 100644
--- a/InvenTree/company/templates/company/manufacturer_part_delete.html
+++ b/InvenTree/company/templates/company/manufacturer_part_delete.html
@@ -33,8 +33,7 @@
{% if part.supplier_parts.all|length > 0 %}
-
There are {{ part.supplier_parts.all|length }} suppliers defined for this manufacturer part. If you delete it, the following supplier parts will also be deleted:
-
+
{% blocktrans %}There are {{ part.supplier_parts.all|length }} suppliers defined for this manufacturer part. If you delete it, the following supplier parts will also be deleted:{% endblocktrans %}
{% if not supplier.selected_purchase_order %}
- {% trans "Select a purchase order for" %} {{ supplier.name }}
+ {% blocktrans %}Select a purchase order for {{ supplier.name }}{% endblocktrans %}
{% endif %}
diff --git a/InvenTree/order/templates/order/receive_parts.html b/InvenTree/order/templates/order/receive_parts.html
index 3daa9119d8..053851f232 100644
--- a/InvenTree/order/templates/order/receive_parts.html
+++ b/InvenTree/order/templates/order/receive_parts.html
@@ -5,7 +5,7 @@
{% block form %}
-{% trans "Receive outstanding parts for" %} {{ order }} - {{ order.description }}
+{% blocktrans %}Receive outstanding parts for {{ order }} - {{ order.description }}{% endblocktrans %}
{% if not supplier.selected_purchase_order %}
- {% blocktrans %}Select a purchase order for {{ supplier.name }}{% endblocktrans %}
+ {% blocktrans with name=supplier.name %}Select a purchase order for {{name}}{% endblocktrans %}
{% endif %}
diff --git a/InvenTree/order/templates/order/receive_parts.html b/InvenTree/order/templates/order/receive_parts.html
index 053851f232..35ce4b6513 100644
--- a/InvenTree/order/templates/order/receive_parts.html
+++ b/InvenTree/order/templates/order/receive_parts.html
@@ -5,7 +5,7 @@
{% block form %}
-{% blocktrans %}Receive outstanding parts for {{ order }} - {{ order.description }}{% endblocktrans %}
+{% blocktrans with desc=order.description %}Receive outstanding parts for {{order}} - {{desc}}{% endblocktrans %}