Skip to content

Sample Templates

Sample Templates

A number of pre-built templates are provided with InvenTree, which can be used as a starting point for creating custom reports and labels.

Users can create their own custom templates, or modify the provided templates to suit their needs.

Report Templates

The following report templates are provided "out of the box" and can be used as a starting point, or as a reference for creating custom reports templates:

Template Model Type Description
Bill of Materials Part Bill of Materials report
Build Order BuildOrder Build Order report
Purchase Order PurchaseOrder Purchase Order report
Return Order ReturnOrder Return Order report
Sales Order SalesOrder Sales Order report
Sales Order Shipment SalesOrderShipment Sales Order Shipment report
Stock Location StockLocation Stock Location report
Test Report StockItem Test Report

Bill of Materials Report

Template: inventree_bill_of_materials_report.html
{% extends "report/inventree_report_base.html" %}

{% load i18n %}
{% load report %}
{% load barcode %}
{% load inventree_extras %}

{% block page_margin %}
margin: 2cm;
margin-top: 4cm;
{% endblock page_margin %}

{% block bottom_left %}
content: "v{{ report_revision }} - {% format_date date %}";
{% endblock bottom_left %}

{% block bottom_center %}
content: "{% inventree_version shortstring=True %}";
{% endblock bottom_center %}

{% block style %}

.header-right {
    text-align: right;
    float: right;
}

.logo {
    height: 20mm;
    vertical-align: middle;
}

.thumb-container {
    width: 32px;
    display: inline;
}

.part-thumb {
    max-width: 32px;
    max-height: 32px;
    display: inline;
}

.part-text {
    display: inline;
}

.part-logo {
    max-width: 60px;
    max-height: 60px;
    display: inline;
}

table {
    border: 1px solid #eee;
    border-radius: 3px;
    border-collapse: collapse;
    width: 100%;
    font-size: 80%;
}

table td {
    border: 1px solid #eee;
}

table td.shrink {
    white-space: nowrap
}

table td.expand {
    width: 99%
}

.invisible-table {
    border: 0px solid transparent;
    border-collapse: collapse;
    width: 100%;
    font-size: 80%;
}

.invisible-table td {
    border: 0px solid transparent;
}

.main-part-text {
    display: inline;
}

.main-part-description {
    display: inline;
}

{% endblock style %}

{% block header_content %}

    <img class='logo' src='{% logo_image %}' alt="InvenTree logo" width='150'>

    <div class='header-right'>
        <h3>{% trans "Bill of Materials" %}</h3>
    </div>

{% endblock header_content %}

{% block page_content %}

<table class="invisible-table">
    <thead>
        <tr>
            <th colspan="2"><h3>{% trans "Part" %}</h3></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <div class='main-part-text'>
                    {{ part.full_name }}
                </div>
                <br/>
                <div class='main-part-description'>
                    {{ part.description }}
                </div>
            </td>
            <td>
                <div class='part-logo'>
                    <img src='{% part_image part height=480 %}' alt='{% trans "Image" %}' class='part-logo'>
                </div>
            </td>
        </tr>
    </tbody>
</table>

<h3>{% trans "Materials needed" %}</h3>
<table class='table table-striped table-condensed'>
    <thead>
        <tr>
            <th>{% trans "Part" %}</th>
            <th>{% trans "Quantity" %}</th>
            <th>{% trans "Reference" %}</th>
            <th>{% trans "Note" %}</th>
        </tr>
    </thead>
    <tbody>
        {% for line in bom_items.all %}
        <tr>
            <td>
                <div class='thumb-container'>
                    <img src='{% part_image line.sub_part height=240 %}' alt='{% trans "Image" %}' class='part-thumb'>
                </div>
                <div class='part-text'>
                    {{ line.sub_part.full_name }}
                </div>
            </td>
            <td>{% decimal line.quantity %}</td>
            <td>{{ line.reference }}</td>
            <td>{{ line.notes }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock page_content %}

Build Order

Template: inventree_build_order_report.html
{% extends "report/inventree_report_base.html" %}

{% load i18n %}
{% load report %}
{% load barcode %}
{% load inventree_extras %}
{% load markdownify %}

{% block page_margin %}
margin: 2cm;
margin-top: 4cm;
{% endblock page_margin %}

{% block style %}

.header-right {
    text-align: right;
    float: right;
}

.logo {
    height: 20mm;
    vertical-align: middle;
}

.part-image {
    border: 1px solid;
    border-radius: 2px;
    vertical-align: middle;
    height: 40mm;
    width: 100%;
    display: inline-block;
    z-index: 100;
}

.details-image {
    float: right;
    width: 30%;
}

.details {
    width: 100%;
    border: 1px solid;
    border-radius: 3px;
    padding: 5px;
    min-height: 42mm;
}

.details table {
    overflow-wrap: break-word;
    word-wrap: break-word;
    width: 65%;
    table-layout: fixed;
    font-size: 75%;
}

.details table td:not(:last-child){
    white-space: nowrap;
}

.details table td:last-child{
    width: 50%;
    padding-left: 1cm;
    padding-right: 1cm;
}

.details-table td {
    padding-left: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #555;
}

{% endblock style %}

{% block bottom_left %}
content: "v{{ report_revision }} - {% format_date date %}";
{% endblock bottom_left %}

{% block header_content %}
    <img class='logo' src="{% logo_image %}" alt="logo" width="150">

    <div class='header-right'>
        <h3>
            Build Order {{ build }}
        </h3>
        <small>{{ quantity }} x {{ part.full_name }}</small>
        <br>
    </div>

    <hr>
{% endblock header_content %}

{% block page_content %}

<div class='details'>
    <div class='details-image'>
        <img class='part-image' alt="{% trans 'Part image' %}" src="{% part_image part height=480 %}">
    </div>

    <div class='details-container'>

        <table class='details-table'>
            <tr>
                <th>{% trans "Build Order" %}</th>
                <td>{% internal_link build.get_absolute_url build %}</td>
            </tr>
            <tr>
                <th>{% trans "Part" %}</th>
                <td>{% internal_link part.get_absolute_url part.full_name %}</td>
            </tr>
            <tr>
                <th>{% trans "Quantity" %}</th>
                <td>{{ build.quantity }}</td>
            </tr>
            <tr>
                <th>{% trans "Description" %}</th>
                <td>{{ build.title }}</td>
            </tr>
            <tr>
                <th>{% trans "Issued" %}</th>
                <td>{% format_date build.creation_date %}</td>
            </tr>
            <tr>
                <th>{% trans "Target Date" %}</th>
                <td>
                    {% if build.target_date %}
                    {% format_date build.target_date %}
                    {% else %}
                    <em>Not specified</em>
                    {% endif %}
                </td>
            </tr>
            <tr>
                <th>{% trans "Sales Order" %}</th>
                <td>
                    {% if build.sales_order %}
                    {% internal_link build.sales_order.get_absolute_url build.sales_order %}
                    {% else %}
                    <em>Not specified</em>
                    {% endif %}
                </td>
            </tr>
            {% if build.parent %}
            <tr>
                <th>{% trans "Required For" %}</th>
                <td>{% internal_link build.parent.get_absolute_url build.parent %}</td>
            </tr>
            {% endif %}
            {% if build.issued_by %}
            <tr>
                <th>{% trans "Issued By" %}</th>
                <td>{{ build.issued_by }}</td>
            </tr>
            {% endif %}
            {% if build.responsible %}
            <tr>
                <th>{% trans "Responsible" %}</th>
                <td>{{ build.responsible }}</td>
            </tr>
            {% endif %}
            {% if build.link %}
            <tr>
                <th>{% trans "Link" %}</th>
                <td><a href="{{ build.link }}">{{ build.link }}</a></td>
            </tr>
            {% endif %}
        </table>
    </div>
</div>

<h3>{% trans "Notes" %}</h3>

{% if build.notes %}
{{ build.notes|markdownify }}
{% endif %}

{% endblock page_content %}

Purchase Order

Template: inventree_bill_of_materials_report.html
{% extends "report/inventree_report_base.html" %}

{% load i18n %}
{% load report %}
{% load barcode %}
{% load inventree_extras %}

{% block page_margin %}
margin: 2cm;
margin-top: 4cm;
{% endblock page_margin %}

{% block bottom_left %}
content: "v{{ report_revision }} - {% format_date date %}";
{% endblock bottom_left %}

{% block bottom_center %}
content: "{% inventree_version shortstring=True %}";
{% endblock bottom_center %}

{% block style %}

.header-right {
    text-align: right;
    float: right;
}

.logo {
    height: 20mm;
    vertical-align: middle;
}

.thumb-container {
    width: 32px;
    display: inline;
}

.part-thumb {
    max-width: 32px;
    max-height: 32px;
    display: inline;
}

.part-text {
    display: inline;
}

.part-logo {
    max-width: 60px;
    max-height: 60px;
    display: inline;
}

table {
    border: 1px solid #eee;
    border-radius: 3px;
    border-collapse: collapse;
    width: 100%;
    font-size: 80%;
}

table td {
    border: 1px solid #eee;
}

table td.shrink {
    white-space: nowrap
}

table td.expand {
    width: 99%
}

.invisible-table {
    border: 0px solid transparent;
    border-collapse: collapse;
    width: 100%;
    font-size: 80%;
}

.invisible-table td {
    border: 0px solid transparent;
}

.main-part-text {
    display: inline;
}

.main-part-description {
    display: inline;
}

{% endblock style %}

{% block header_content %}

    <img class='logo' src='{% logo_image %}' alt="InvenTree logo" width='150'>

    <div class='header-right'>
        <h3>{% trans "Bill of Materials" %}</h3>
    </div>

{% endblock header_content %}

{% block page_content %}

<table class="invisible-table">
    <thead>
        <tr>
            <th colspan="2"><h3>{% trans "Part" %}</h3></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <div class='main-part-text'>
                    {{ part.full_name }}
                </div>
                <br/>
                <div class='main-part-description'>
                    {{ part.description }}
                </div>
            </td>
            <td>
                <div class='part-logo'>
                    <img src='{% part_image part height=480 %}' alt='{% trans "Image" %}' class='part-logo'>
                </div>
            </td>
        </tr>
    </tbody>
</table>

<h3>{% trans "Materials needed" %}</h3>
<table class='table table-striped table-condensed'>
    <thead>
        <tr>
            <th>{% trans "Part" %}</th>
            <th>{% trans "Quantity" %}</th>
            <th>{% trans "Reference" %}</th>
            <th>{% trans "Note" %}</th>
        </tr>
    </thead>
    <tbody>
        {% for line in bom_items.all %}
        <tr>
            <td>
                <div class='thumb-container'>
                    <img src='{% part_image line.sub_part height=240 %}' alt='{% trans "Image" %}' class='part-thumb'>
                </div>
                <div class='part-text'>
                    {{ line.sub_part.full_name }}
                </div>
            </td>
            <td>{% decimal line.quantity %}</td>
            <td>{{ line.reference }}</td>
            <td>{{ line.notes }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock page_content %}

Return Order

Template: inventree_return_order_report.html
{% extends "report/inventree_order_report_base.html" %}

{% load i18n %}
{% load report %}
{% load barcode %}
{% load inventree_extras %}
{% load markdownify %}

{% block header_content %}
<img class='logo' src='{% company_image customer %}' alt="{{ customer }}" width='150'>

<div class='header-right'>
    <h3>{% trans "Return Order" %} {{ prefix }}{{ reference }}</h3>
    {% if customer %}{{ customer.name }}{% endif %}
</div>
{% endblock header_content %}

{% block page_content %}
<h3>{% trans "Line Items" %}</h3>

<table class='table table-striped table-condensed'>
    <thead>
        <tr>
            <th>{% trans "Part" %}</th>
            <th>{% trans "Serial Number" %}</th>
            <th>{% trans "Reference" %}</th>
            <th>{% trans "Note" %}</th>
        </tr>
    </thead>
    <tbody>
        {% for line in lines.all %}
        <tr>
            <td>
                <div class='thumb-container'>
                    <img src='{% part_image line.item.part height=240 %}' alt='{% trans "Image" %}' class='part-thumb'>
                </div>
                <div class='part-text'>
                    {{ line.item.part.full_name }}
                </div>
            </td>
            <td>{{ line.item.serial }}</td>
            <td>{{ line.reference }}</td>
            <td>{{ line.notes }}</td>
        </tr>
        {% endfor %}

        {% if extra_lines %}
        <tr><th colspan='4'>{% trans "Extra Line Items" %}</th></tr>
        {% for line in extra_lines.all %}
        <tr>
            <td><!-- No part --></td>
            <td><!-- No serial --></td>
            <td>{{ line.reference }}</td>
            <td>{{ line.notes }}</td>
        </tr>
        {% endfor %}
        {% endif %}
    </tbody>

</table>

{% endblock page_content %}

Sales Order

Template: inventree_sales_order_report.html
{% extends "report/inventree_order_report_base.html" %}

{% load i18n %}
{% load report %}
{% load barcode %}
{% load inventree_extras %}
{% load markdownify %}

{% block header_content %}

    <img class='logo' src='{% company_image customer %}' alt="{{ customer }}" width='150'>

    <div class='header-right'>
        <h3>{% trans "Sales Order" %} {{ prefix }}{{ reference }}</h3>
        {{ customer.name }}
    </div>

{% endblock header_content %}

{% block page_content %}

<h3>{% trans "Line Items" %}</h3>

<table class='table table-striped table-condensed'>
    <thead>
        <tr>
            <th>{% trans "Part" %}</th>
            <th>{% trans "Reference" %}</th>
            <th>{% trans "Quantity" %}</th>
            <th>{% trans "Unit Price" %}</th>
            <th>{% trans "Total Price" %}</th>
            <th>{% trans "Note" %}</th>
        </tr>
    </thead>
    <tbody>
        {% for line in lines.all %}
        <tr>
            <td>
                <div class='thumb-container'>
                    <img src='{% part_image line.part height=240 %}' alt='{% trans "Part image" %}' class='part-thumb'>
                </div>
                <div class='part-text'>
                    {{ line.part.full_name }}
                </div>
            </td>
            <td>{{ line.reference }}</td>
            <td>{% decimal line.quantity %}</td>
            <td>{% render_currency line.price %}</td>
            <td>{% render_currency line.total_line_price %}</td>
            <td>{{ line.notes }}</td>
        </tr>
        {% endfor %}

        {% if extra_lines %}
        <tr><th colspan='6'>{% trans "Extra Line Items" %}</th></tr>
        {% for line in extra_lines.all %}
        <tr>
            <td><!-- No part --></td>
            <td>{{ line.reference }}</td>
            <td>{% decimal line.quantity %}</td>
            <td>{% render_currency line.price %}</td>
            <td>{% render_currency line.total_line_price %}</td>
            <td>{{ line.notes }}</td>
        </tr>
        {% endfor %}
        {% endif %}

        <tr>
            <td></td>
            <td></td>
            <td></td>
            <th>{% trans "Total" %}</th>
            <td>{% render_currency order.total_price currency=order.currency %}</td>
            <td></td>
        </tr>
    </tbody>
</table>

{% endblock page_content %}

Sales Order Shipment

Template: inventree_sales_order_shipment_report.html
{% extends "report/inventree_order_report_base.html" %}

{% load i18n %}
{% load report %}
{% load barcode %}
{% load inventree_extras %}
{% load markdownify %}

{% block header_content %}

    <img class='logo' src='{% company_image order.customer %}' alt="{{ order.customer }}" width='150'>

    <div class='header-right'>
        <h3>{% trans "Shipment" %} {{ prefix }}{{ reference }}</h3>
        <i>{% trans "Sales Order" %} {{ order.reference }}</i><br/>
        {{ order.customer.name }}
    </div>

{% endblock header_content %}

{% block page_content %}

<h3>{% trans "Allocations" %}</h3>

<table class='table table-striped table-condensed'>
    <thead>
        <tr>
            <th>{% trans "Part" %}</th>
            <th>{% trans "Stock Item" %}</th>
        </tr>
    </thead>
    <tbody>
        {% for allocation in allocations.all %}
        <tr>
            <td>
                <div class='thumb-container'>
                    <img src='{% part_image allocation.line.part height=240 %}' alt='{% trans "Part image" %}' class='part-thumb'>
                </div>
                <div class='part-text'>
                    {{ allocation.line.part.full_name }}
                </div>
            </td>

            {% if allocation.item and allocation.item.serial and allocation.quantity == 1 %}
                <td>{% trans "Serial Number" %}: {{ allocation.item.serial }}</td>
            {% elif allocation.item and allocation.item.batch %}
                <td>{% trans "Quantity" %}: {% decimal allocation.quantity %} - <i>{% trans "Batch" %}: {{ allocation.item.batch }}</i></td>
            {% else %}
                <td>{% trans "Quantity" %}: {% decimal allocation.quantity %}</td>
            {% endif %}
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock page_content %}

Stock Location

Template: inventree_stock_location_report.html
{% extends "report/inventree_report_base.html" %}

{% load i18n %}
{% load report %}
{% load barcode %}
{% load inventree_extras %}

{% block page_margin %}
margin: 2cm;
margin-top: 4cm;
{% endblock page_margin %}

{% block bottom_left %}
content: "v{{ report_revision }} - {% format_date date %}";
{% endblock bottom_left %}

{% block bottom_center %}
content: "{% inventree_version shortstring=True %}";
{% endblock bottom_center %}

{% block style %}

.header-right {
    text-align: right;
    float: right;
}

.logo {
    height: 20mm;
    vertical-align: middle;
}

.thumb-container {
    width: 32px;
    display: inline;
}

.part-thumb {
    max-width: 32px;
    max-height: 32px;
    display: inline;
}

.part-text {
    display: inline;
}

.part-logo {
    max-width: 60px;
    max-height: 60px;
    display: inline;
}

table {
    border: 1px solid #eee;
    border-radius: 3px;
    border-collapse: collapse;
    width: 100%;
    font-size: 80%;
}

table td {
    border: 1px solid #eee;
}

table td.shrink {
    white-space: nowrap
}

table td.expand {
    width: 99%
}

.invisible-table {
    border: 0px solid transparent;
    border-collapse: collapse;
    width: 100%;
    font-size: 80%;
}

.invisible-table td {
    border: 0px solid transparent;
}

.main-part-text {
    display: inline;
}

.main-part-description {
    display: inline;
}

{% endblock style %}

{% block page_content %}

<h3>{% trans "Stock location items" %}</h3>
<h3>{{ stock_location.name }}</h3>
<table class='table table-striped table-condensed'>
    <thead>
        <tr>
            <th>{% trans "Part" %}</th>
            <th>{% trans "IPN" %}</th>
            <th>{% trans "Quantity" %}</th>
            <th>{% trans "Note" %}</th>
        </tr>
    </thead>
    <tbody>
        {% for line in stock_items.all %}
        <tr>
            <td>
                <div class='part-text'>
                {{ line.part.full_name }}
                </div>
            </td>
            <td>{{ line.part.IPN }}</td>
            <td>{% decimal line.quantity %}</td>
            <td>{{ line.notes }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock page_content %}

Test Report

Template: inventree_test_report.html
{% extends "report/inventree_report_base.html" %}

{% load i18n %}
{% load report %}
{% load inventree_extras %}

{% block style %}
.test-table {
    width: 100%;
}

{% block bottom_left %}
content: "{% format_date date %}";
{% endblock bottom_left %}

{% block bottom_center %}
content: "{% inventree_version shortstring=True %}";
{% endblock bottom_center %}

{% block top_center %}
content: "{% trans 'Stock Item Test Report' %}";
{% endblock top_center %}

.test-row {
    padding: 3px;
}

.test-pass {
    color: #5f5;
}

.test-fail {
    color: #F55;
}

.test-not-found {
    color: #33A;
}

.required-test-not-found {
    color: #EEE;
    background-color: #F55;
}

.container {
    padding: 5px;
    border: 1px solid;
}

.text-left {
    display: inline-block;
    width: 50%;
}

.img-right {
    display: inline;
    align-content: right;
    align-items: right;
    width: 50%;
}

.part-img {
    height: 4cm;
}

{% endblock style %}

{% block pre_page_content %}

{% endblock pre_page_content %}

{% block page_content %}

<div class='container'>
    <div class='text-left'>
        <h2>
            {{ part.full_name }}
        </h2>
        <p>{{ part.description }}</p>
        <p><em>{{ stock_item.location }}</em></p>
        <p><em>Stock Item ID: {{ stock_item.pk }}</em></p>
    </div>
    <div class='img-right'>
        <img class='part-img' alt='{% trans "Part image" %}' src="{% part_image part height=480 %}">
        <hr>
        <h4>
            {% if stock_item.is_serialized %}
            {% trans "Serial Number" %}: {{ stock_item.serial }}
            {% else %}
            {% trans "Quantity" %}: {% decimal stock_item.quantity %}
            {% endif %}
        </h4>
    </div>
</div>

{% if test_keys|length > 0 %}
<h3>{% trans "Test Results" %}</h3>

<table class='table test-table'>
    <thead>
        <tr>
            <th>{% trans "Test" %}</th>
            <th>{% trans "Result" %}</th>
            <th>{% trans "Value" %}</th>
            <th>{% trans "User" %}</th>
            <th>{% trans "Date" %}</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan='5'><hr></td>
        </tr>
        {% for key in test_keys %}
        {% getkey test_templates key as test_template %}
        {% getkey results key as test_result %}
        <tr class='test-row'>
            <td>
                {% if test_template %}
                {% render_html_text test_template.test_name bold=test_template.required %}
                {% elif test_result %}
                {% render_html_text test_result.test italic=True %}
                {% else %}
                <!-- No matching test template or result for {{ key }} -->
                <span style='color: red;'>{{ key }}</span>
                {% endif %}
            </td>
            {% if test_result %}
            {% if test_result.result %}
            <td class='test-pass'>{% trans "Pass" %}</td>
            {% else %}
            <td class='test-fail'>{% trans "Fail" %}</td>
            {% endif %}
            <td>{{ test_result.value }}</td>
            <td>{{ test_result.user.username }}</td>
            <td>{% format_date test_result.date.date %}</td>
            {% else %}
            {% if test_template.required %}
            <td colspan='4' class='required-test-not-found'>{% trans "No result (required)" %}</td>
            {% else %}
            <td colspan='4' class='test-not-found'>{% trans "No result" %}</td>
            {% endif %}
            {% endif %}
        </tr>
        {% endfor %}
    </tbody>

</table>
{% else %}
<em>No tests defined for this stock item</em>
{% endif %}

{% if installed_items|length > 0 %}
<h3>{% trans "Installed Items" %}</h3>

<table class='table test-table'>
    <thead>
    </thead>
    <tbody>
    {% for sub_item in installed_items %}
        <tr>
            <td>
                <img src='{% part_image sub_item.part height=240 %}' class='part-img' alt='{% trans "Part image" %}' style='max-width: 24px; max-height: 24px;'>
                {{ sub_item.part.full_name }}
            </td>
            <td>
                {% if sub_item.serialized %}
                {% trans "Serial" %}: {{ sub_item.serial }}
                {% else %}
                {% trans "Quantity" %}: {% decimal sub_item.quantity %}
                {% endif %}
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>

{% endif %}

{% endblock page_content %}

{% block post_page_content %}

{% endblock post_page_content %}

Label Templates

The following label templates are provided "out of the box" and can be used as a starting point, or as a reference for creating custom label templates:

Template Model Type Description
Build Line Build line item Build Line label
Part Part Part label
Stock Item StockItem Stock Item label
Stock Location StockLocation Stock Location label

Build Line Label

Template: buildline_label.html
{% extends "label/label_base.html" %}
{% load barcode report %}
{% load inventree_extras %}

<!--
This is an example template for printing labels against BuildLine objects.
Refer to the documentation for a full list of available template variables.
-->

{% block style %}

{{ block.super }}

.label {
  margin: 1mm;
}

.qr {
  position: absolute;
  height: 28mm;
  width: 28mm;
  top: 0mm;
  right: 0mm;
  float: right;
}

.label-table {
  width: 100%;
  border-collapse: collapse;
  border: 1pt solid black;
}

.label-table tr {
  width: 100%;
  border-bottom: 1pt solid black;
  padding: 2.5mm;
}

.label-table td {
  padding: 3mm;
}

{% endblock style %}

{% block content %}

<div class='label'>
<table class='label-table'>
  <tr>
    <td>
      <b>Build Order:</b> {{ build.reference }}<br>
      <b>Build Qty:</b> {% decimal build.quantity %}<br>
    </td>
    <td>
      <img class='qr' alt='build qr' src='{% qrcode build.barcode %}'>
    </td>
  </tr>
  <tr>
    <td>
      <b>Part:</b> {{ part.name }}<br>
      {% if part.IPN %}
      <b>IPN:</b> {{ part.IPN }}<br>
      {% endif %}
      <b>Qty / Unit:</b> {% decimal bom_item.quantity %} {% if part.units %}[{{ part.units }}]{% endif %}<br>
      <b>Qty Total:</b> {% decimal quantity %} {% if part.units %}[{{ part.units }}]{% endif %}
    </td>
    <td>
      <img class='qr' alt='part qr' src='{% qrcode part.barcode %}'>
    </td>
  </tr>
</table>
</div>

{% endblock content %}

Part Label

Template: part_label_code128.html
{% extends "label/label_base.html" %}

{% load l10n i18n barcode %}

{% block style %}

.qr {
    position: absolute;
    left: 0mm;
    top: 0mm;
    {% localize off %}
    height: {{ height }}mm;
    width: {{ height }}mm;
    {% endlocalize %}
}

.part {
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    position: absolute;
    {% localize off %}
    left: {{ height }}mm;
    {% endlocalize %}
    top: 2mm;
}

{% endblock style %}

{% block content %}

<img class='qr' alt='{% trans "QR code" %}' src='{% barcode qr_data %}'>

<div class='part'>
    {{ part.full_name }}
</div>

{% endblock content %}

Stock Item Label

Template: stockitem_qr.html
{% extends "label/label_base.html" %}

{% load l10n i18n barcode %}

{% block style %}

.qr {
    position: absolute;
    left: 0mm;
    top: 0mm;
    {% localize off %}
    height: {{ height }}mm;
    width: {{ height }}mm;
    {% endlocalize %}
}

{% endblock style %}

{% block content %}

<img class='qr' alt="{% trans 'QR Code' %}" src='{% qrcode qr_data %}'>
{% endblock content %}

Stock Location Label

Template: stocklocation_qr_and_text.html
{% extends "label/label_base.html" %}

{% load l10n i18n barcode %}

{% block style %}

.qr {
    position: absolute;
    left: 0mm;
    top: 0mm;
    {% localize off %}
    height: {{ height }}mm;
    width: {{ height }}mm;
    {% endlocalize %}
}

.loc {
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    position: absolute;
    {% localize off %}
    left: {{ height }}mm;
    {% endlocalize %}
    top: 2mm;
}

{% endblock style %}

{% block content %}

<img class='qr' alt="{% trans 'QR code' %}" src='{% qrcode qr_data %}'>

<div class='loc'>
    {{ location.name }}
</div>

{% endblock content %}