55 lines
2.8 KiB
XML
55 lines
2.8 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<odoo>
|
|
<data>
|
|
<record id="report_citizen_label" model="ir.actions.report">
|
|
<field name="name">Citizen ZPL Label</field>
|
|
<field name="model">stock.lot</field>
|
|
<field name="report_type">qweb-text</field>
|
|
<field name="report_name">citizen_zpl_printer.label_citizen_template_view</field>
|
|
<field name="report_file">citizen_zpl_printer.label_citizen_template_view</field>
|
|
<field name="binding_model_id" eval="False"/>
|
|
</record>
|
|
|
|
<template id="label_citizen_template_view">
|
|
<t t-foreach="docs" t-as="lot">
|
|
<t t-translation="off">
|
|
^XA^CI28
|
|
^PW<t t-esc="res_company.zpl_label_width"/>
|
|
^LL<t t-esc="res_company.zpl_label_height"/>
|
|
^FO<t t-esc="res_company.zpl_margin_left"/>,<t t-esc="res_company.zpl_margin_top"/>
|
|
^A0N,<t t-esc="res_company.zpl_font_size"/>,<t t-esc="int(res_company.zpl_font_size * 0.75)"/>^FD<t t-out="lot.product_id.display_name"/>^FS
|
|
^FO<t t-esc="res_company.zpl_margin_left"/>,<t t-esc="res_company.zpl_margin_top + res_company.zpl_font_size + 10"/>
|
|
^A0N,<t t-esc="res_company.zpl_font_size"/>,<t t-esc="int(res_company.zpl_font_size * 0.75)"/>^FDLN/SN: <t t-out="lot.name"/>^FS
|
|
|
|
<t t-set="barcode_y" t-value="res_company.zpl_margin_top + (res_company.zpl_font_size * 2) + 20"/>
|
|
<t t-if="env.user.has_group('stock.group_stock_lot_print_gs1')">
|
|
<t t-set="final_barcode" t-value="''" />
|
|
<t t-if="lot.product_id.valid_ean" t-set="final_barcode" t-value="'01' + '0' * (14 - len(lot.product_id.barcode)) + lot.product_id.barcode"/>
|
|
<t t-if="lot.product_id.tracking == 'lot'" name="datamatrix_lot" t-set="final_barcode" t-value="(final_barcode or '') + '10' + lot.name"/>
|
|
<t t-elif="lot.product_id.tracking == 'serial'" t-set="final_barcode" t-value="(final_barcode or '') + '21' + lot.name"/>
|
|
^FO<t t-esc="res_company.zpl_margin_left"/>,<t t-esc="barcode_y"/>^BY<t t-esc="res_company.zpl_barcode_width"/>
|
|
^BXN,<t t-esc="int(res_company.zpl_barcode_height / 10)"/>,200
|
|
^FD<t t-out="final_barcode"/>^FS
|
|
</t>
|
|
<t t-else="" name="code128_barcode">
|
|
^FO<t t-esc="res_company.zpl_margin_left"/>,<t t-esc="barcode_y"/>^BY<t t-esc="res_company.zpl_barcode_width"/>
|
|
^BCN,<t t-esc="res_company.zpl_barcode_height"/>,Y,N,N
|
|
^FD<t t-out="lot.name"/>^FS
|
|
</t>
|
|
|
|
<t t-set="logo_x" t-value="res_company.zpl_margin_left + 200"/>
|
|
<t t-set="custom_x" t-value="res_company.zpl_margin_left + 350"/>
|
|
<t t-set="img_y" t-value="barcode_y"/>
|
|
|
|
<t t-out="'^FO%s,%s' % (logo_x, img_y)"/>
|
|
<t t-out="(lot.company_id or res_company).get_zpl_logo_string()"/>
|
|
<t t-out="'^FO%s,%s' % (custom_x, img_y)"/>
|
|
<t t-out="(lot.company_id or res_company).get_zpl_custom_image_string()"/>
|
|
|
|
^XZ
|
|
</t>
|
|
</t>
|
|
</template>
|
|
</data>
|
|
</odoo>
|