Update of Snippet
This commit is contained in:
1 parent
9bc36eafc4
commit
d4d6175ea3
1 file changed
+35
-24
@@ -6,36 +6,47 @@
|
||||
<t t-call="web.basic_layout">
|
||||
<t t-call="web.html_container">
|
||||
|
||||
<table style="border: 1px solid white; height: 23mm; width: 38mm; background-color: white;">
|
||||
<table style="border: 1px solid white; height: 23mm; width: 38mm; background-color: white; font-size:7pt; position:relative; left:-10px;">
|
||||
<tr>
|
||||
<td>
|
||||
<span t-out="o.product_id.default_code"/>
|
||||
<div t-att-style="'position:relative; width:45mm; height:20mm; margin-top: 5px; border: 0px solid %s;' % (o.env.user.company_id.primary_color or 'black')">
|
||||
<t t-set="final_barcode" t-value="''"/>
|
||||
<t t-if="env.user.has_group('stock.group_stock_lot_print_gs1')">
|
||||
<t t-if="o.product_id.valid_ean" t-set="final_barcode" t-value="'01' + '0' * (14 - len(o.product_id.barcode)) + o.product_id.barcode"/>
|
||||
<t name="gs1_datamatrix_lot" t-if="o.product_id.tracking == 'lot'" t-set="final_barcode" t-value="(final_barcode or '') + o.name"/>
|
||||
<t t-elif="o.product_id.tracking == 'serial'" t-set="final_barcode" t-value="(final_barcode or '') + o.name"/>
|
||||
</t>
|
||||
|
||||
<div class="o_label_4x12" t-if="o.product_id.default_code" t-att-style="'width:22mm' if final_barcode else ''">[<t t-out="o.product_id.default_code"/>]</div>
|
||||
<div class="o_label_4x12" t-esc="o.product_id.name[:30]" t-att-style="'width:22mm; font-weight: bold' if final_barcode else ''">Demo Product</div>
|
||||
<div class="o_label_4x12" t-esc="'Qty ' + str(o.product_qty)" t-att-style="'width:22mm; font-weight: bold; margin-top: 5px' if final_barcode else ''">Demo Qty</div>
|
||||
|
||||
<!--
|
||||
<div class="o_label_4x12" name="lot_name" t-field="o.name" t-att-style="'width:22mm' if final_barcode else ''">Demo Lot/SN</div>
|
||||
-->
|
||||
<t t-if="env.user.has_group('stock.group_stock_lot_print_gs1')">
|
||||
|
||||
<!--
|
||||
<div t-if="final_barcode" t-att-style="'position:absolute; right:.5px; bottom:.5px'">
|
||||
-->
|
||||
|
||||
<div t-if="final_barcode" t-att-style="'position:absolute; right:.5px; top:.5px'">
|
||||
<span t-out="final_barcode" t-options="{'widget': 'barcode', 'symbology': 'ECC200DataMatrix', 'img_style': 'width:17mm; height:17mm'}">12345678901</span>
|
||||
</div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<span t-field="o.name" t-options="{'widget': 'barcode', 'img_style': 'width:100%; height:35%'}">Demo Lot/SN</span>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span t-if="len(o.product_id.name) <= 20" t-out="o.product_id.name" style="font-size:8pt;"/>
|
||||
|
||||
<span t-elif="len(o.product_id.name) <= 40" t-out="o.product_id.name" style="font-size:6pt;"/>
|
||||
|
||||
<span t-else="" t-out="o.product_id.name" style="font-size:4pt;"/>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div class="o_label_4x12" name="lot_name" t-field="o.name" t-att-style="'width:100%' if final_barcode else ''">Demo Lot/SN</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span t-out="o.name" style="font-size:10pt;"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="text-center">
|
||||
<span t-if="o.name" t-esc="o.name" style="margin-bottom: 0px;" t-options="{'widget': 'barcode', 'humanreadable': 0, 'quiet': 0, 'symbology': 'auto','img_style': 'width:50mm;height:7mm;display:block;margin:0;padding-right:5px;'}">
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</t>
|
||||
|
||||
Reference in new issue
Block a user