part parameters in label templates #9374
Replies: 3 comments 1 reply
-
|
Your example here looks like it should work - according to the docs |
Beta Was this translation helpful? Give feedback.
-
|
This example doesn't seem to work when using either part or stock item as the label type. Running a fresh install of 1.1.6 Below is my modified code; I just need to print the customized parameter OEM part number on each label as well as the name and internal part number and QR code. I originally named the field OEM# or OEM P/N so I tried to rename and create new parameters that were simpler like OEM Part Number and OEM but neither of those seemed to work either even though I had applied the parameter to the test part before previewing. {% extends "label/label_base.html" %}
{% load l10n i18n barcode report %}
{% part_parameter item.part "OEM" as oem %}
{% 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;
font-size: 12px;
}
.small {
font-family: Arial, Helvetica, sans-serif;
display: flex;
font-size: 8px;
position: absolute;
{% localize off %}
left: {{ height }}mm;
{% endlocalize %}
top: 15mm;
}
{% endblock style %}
{% block content %}
<img class='qr' alt="{% trans 'QR Code' %}" src='{% qrcode qr_data %}'>
<div class='part'>
{{ part.full_name }}
</div>
<div class='small'>
<strong>OEM#: </strong>{{ oem.data }}
</div>
{% endblock content %}
|
Beta Was this translation helpful? Give feedback.
-
|
Seems to work for me:
|
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How can i use the parameter in the custom stock_items label?
Beta Was this translation helpful? Give feedback.
All reactions