Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP]stock_batch_picking_ux: picking label for batch #555

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
357 changes: 357 additions & 0 deletions stock_batch_picking_ux/report/picking_templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,357 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="stock_batch_picking_ux.custom_label_transfer_template_view_zpl">
<t t-foreach="docs" t-as="picking">
<t t-set="numero" t-value="0"/>
<t t-set="qty" t-value="picking.number_of_packages"/>
<t t-if="qty == 0">
<t t-set="qty" t-value="1"/>
</t>
<t t-foreach="range(qty)" t-as="item">
<t t-set="numero" t-value="numero + 1"/>
<t t-translation="off">
^XA
<!-- Inicio encabezado -->
<t t-if="picking.book_id">
<t t-if="picking.book_id.report_partner_id">
^CF0,60^CI28^FO50,50^FD
<t t-esc="picking.book_id.report_partner_id.name"/>
^FS ^CF0,30 ^FO50,115^FD
<t t-esc="picking.book_id.report_partner_id.street"/>
^FS ^FO50,155^FD
(<t t-esc="picking.partner_id.zip"/>
)<t t-esc="picking.book_id.report_partner_id.city"/>
^FS ^FO50,195^FD
<t class="oe_inline" t-esc="picking.book_id.report_partner_id.state_id.name"/>
,
<t class="oe_inline" t-esc="picking.book_id.report_partner_id.country_id.name"/>
^FS ^FO50,250^GB700,3,3^FS
</t>
<t t-else="">
^CF0,60^CI28^FO50,50^FD
<t t-esc="picking.book_id.company_id.name"/>
^FS ^CF0,30 ^FO50,115^FD
<t t-esc="picking.book_id.company_id.street"/>
^FS ^FO50,155^FD
(<t t-esc="picking.company_id.zip"/>
)<t t-esc="picking.book_id.company_id.city"/>
^FS ^FO50,195^FD
<t class="oe_inline" t-esc="picking.book_id.company_id.state_id.name"/>
,
<t class="oe_inline" t-esc="picking.book_id.company_id.country_id.name"/>
^FS ^FO50,250^GB700,3,3^FS
</t>
</t>
<t t-else="">
^CF0,60 ^FO50,50^FD
<t t-esc="picking.company_id.name"/>
^FS ^CF0,30 ^CI28 ^FO50,115^FD
<t t-esc="picking.company_id.street"/>
^FS ^FO50,155^FD
(<t t-esc="picking.company_id.zip"/>
)<t t-esc="picking.company_id.city"/>
^FS ^FO50,195^FD
<t class="oe_inline" t-esc="picking.company_id.state_id.name"/>
,
<t class="oe_inline" t-esc="picking.company_id.country_id.name"/>

^FS ^FO50,250^GB700,3,3^FS
<!-- Fin encabezado -->
</t>
<!-- Inicio destino -->
<t t-if="picking.partner_id.parent_id">
^FX Second section with recipient address and permit information. ^CFJ,23 ^FO50,280^FDDestinatario^FS ^CF0,45 ^TBN,700,100
^FO50,310^FD
<t t-esc="picking.partner_id.parent_id.name"/>
^FS
</t>
<t t-else="">
^FX Second section with recipient address and permit information. ^CFJ,23 ^FO50,280^FDDestinatario^FS ^CF0,45 ^TBN,700,100
^FO50,310^FD
<t t-esc="picking.partner_id.name"/>
^FS
</t>
^CF0,30 ^FO50,425^FD
<t t-esc="picking.partner_id.street"/>
^FS ^FO50,465^FD
<t class="oe_inline" t-esc="picking.partner_id.zip"/>
,
<t class="oe_inline" t-esc="picking.partner_id.city"/>
^FS ^FO50,505^FD
<t class="oe_inline" t-esc="picking.partner_id.state_id.name"/>
,
<t class="oe_inline" t-esc="picking.partner_id.country_id.name"/>
^FS ^FO50,545^FDTel: ^FS
<t t-if="picking.partner_id and (picking.partner_id.phone != False or picking.partner_id.mobile != False)">
<t t-if="picking.partner_id.phone">
^FO100,545^FD
<t t-esc="picking.partner_id.phone"/>
^FS
</t>
<t t-else="">
^FO100,545^FD
<t t-esc="picking.partner_id.mobile"/>
^FS
</t>
</t>
<t t-if="picking.partner_id.parent_id and (picking.partner_id.parent_id.phone != False or picking.partner_id.parent_id.mobile != False) and (picking.partner_id.phone == False and picking.partner_id.mobile == False)">
<t t-if="picking.partner_id.parent_id.phone">
^FO100,545^FD
<t t-esc="picking.partner_id.parent_id.phone"/>
^FS
</t>
<t t-else="">
^FO100,545^FD
<t t-esc="picking.partner_id.parent_id.mobile"/>
^FS
</t>
</t>
<t t-else="">
^FS
</t>
<!-- Fin destino -->
<t t-if="picking._fields.get('carrier_id') and picking.carrier_id">
Transportista:
^FX Transportista ^CFJ,30 ^FO50,615^FDTransportista: ^FS ^FO260,615^FD
<t t-esc="picking.carrier_id.name"/>
</t>
<t t-else="">
</t>
^FS^FS ^FO50,655^GB700,3,3^FS
^FX Referencias Odoo ^CFJ,25 ^FO50,680^FDOrden:^FS ^FO50,720^FDRemito:^FS ^CF0,28 ^FO160,680^FD
<t t-esc="picking.origin"/>
^FS ^FO160,720^FD
<t t-set="voucher_names" t-value="','.join(picking.voucher_ids.mapped('name'))"/>
<t t-esc="voucher_names"/>
^FS ^BY3,2,160 ^FO100,765^BC^FD
<t t-esc="picking.name"/>
^FS ^FX Fecha y nro de bultos ^FO50,980^GB700,170,3^FS ^FO400,980^GB3,170,3^FS ^CFJ,30 ^FO180,1020^FDBultos^FS
^CF0,50 ^FO160,1070^FD<t t-esc="numero"/>
de <t t-if="picking.number_of_packages == 0">1</t>
<t t-else="">
<t t-esc="picking.number_of_packages"/>
</t>^FS ^CFJ,30 ^FO520,1020^FD
Fecha
^FS ^CF0,50 ^FO460,1070^FD
<t t-esc="picking.date_done" t-options="{'widget': 'date'}"/>
^FS ^XZ
</t>
</t>
</t>
</template>
<template id="stock_batch_picking_ux.custom_label_transfer_template_view_pdf">
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="picking">
<t t-set="numero" t-value="0"/>
<t t-set="qty" t-value="picking.number_of_packages"/>
<t t-if="qty == 0">
<t t-set="qty" t-value="1"/>
</t>
<t t-foreach="range(qty)" t-as="item">
<t t-set="numero" t-value="numero + 1"/>
<t t-translation="off">
<!--inicio encabezado-->
<div class="container" style="page-break-before: always;">
<div name="section0" class="row">
<div class="col-12" style="page-break-before: always;">
<t t-if="picking._fields.get('book_id') and picking.book_id">
<t t-if="picking.book_id.report_partner_id">
<h4>
<span t-field="picking.book_id.report_partner_id.name"/>
</h4>
<br/>
<span t-field="picking.book_id.report_partner_id.street"/>
<br/>

( <span t-field="picking.partner_id.zip"/>
) <span t-field="picking.book_id.report_partner_id.city"/>
<br/>
<span class="oe_inline" t-field="picking.book_id.report_partner_id.state_id.name"/>
,
<span class="oe_inline" t-field="picking.book_id.report_partner_id.country_id.name"/>

</t>
<t t-else="">
<h4>
<span t-field="picking.book_id.company_id.name"/>
</h4>

<span t-field="picking.book_id.company_id.street"/>
<br/>
( <span t-field="picking.company_id.zip"/>
) <span t-field="picking.book_id.company_id.city"/>
<br/>
<span class="oe_inline" t-field="picking.book_id.company_id.state_id.name"/>
,
<span class="oe_inline" t-field="picking.book_id.company_id.country_id.name"/>
</t>
</t>
<t t-else="">
<h4>
<span t-field="picking.company_id.name"/>
</h4>
<br/>
<span t-field="picking.company_id.street"/>
<br/>
( <span t-field="picking.company_id.zip"/>
) <span t-field="picking.company_id.city"/>
<br/>
<span class="oe_inline" t-field="picking.company_id.state_id.name"/>
,
<span class="oe_inline" t-field="picking.company_id.country_id.name"/>
</t>

</div>
</div>

<!--Fin encabezado-->
<hr style="border-top: 1px solid black"/>
<!-- Inicio destino -->
<div style="font-weight: normal;">Destinatario:</div>
<h4 style="font-weight: normal;">
<t t-if="picking.partner_id.parent_id">
<t t-esc="picking.partner_id.parent_id.name"/>
</t>
<t t-else="">
<t t-esc="picking.partner_id.name"/>
</t>
</h4>

<t t-esc="picking.partner_id.street"/>
<br/>
[ <t class="oe_inline" t-esc="picking.partner_id.zip"/>
]
<t class="oe_inline" t-esc="picking.partner_id.city"/>
,
<t class="oe_inline" t-esc="picking.partner_id.state_id.name"/>
,
<t class="oe_inline" t-esc="picking.partner_id.country_id.name"/>
<div style="font-weight: normal;">Tel:
<t t-if="picking.partner_id and (picking.partner_id.phone != False or picking.partner_id.mobile != False)">
<t t-if="picking.partner_id.phone">
<t t-esc="picking.partner_id.phone"/>
</t>
<t t-else="">
<t t-esc="picking.partner_id.mobile"/>
</t>
</t>
<t t-if="picking.partner_id.parent_id and (picking.partner_id.parent_id.phone != False or picking.partner_id.parent_id.mobile != False) and (picking.partner_id.phone == False and picking.partner_id.mobile == False)">
<t t-if="picking.partner_id.parent_id.phone">
<t t-esc="picking.partner_id.parent_id.phone"/>
</t>
<t t-else="">
<t t-esc="picking.partner_id.parent_id.mobile"/>
</t>
</t>
<t t-else="">
</t>
</div>
<!-- Fin destino -->
<hr style="border-top: 1px solid black"/>
<!--Inicio pie-->

<t t-if="picking._fields.get('carrier_id') and picking.carrier_id">
Transportista:
<t t-esc="picking.carrier_id.name"/>
</t>
<t t-else="">
</t>
<div style="font-weight: normal;">Orden:
<t t-esc="picking.origin"/>
</div>
<div style="font-weight: normal;">Remito/s:
<t t-set="voucher_names" t-value="','.join(picking.voucher_ids.mapped('name'))"/>
<t t-esc="voucher_names"/>
</div>
<br/>
<div name="footer_left_column" position="inside">
<img t-if="picking.name" t-att-src="'/report/barcode/?barcode_type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', picking.name, 400, 40)" alt="barcode" style="height:40"/>
</div>

<div style="text-align: center;">
<t t-esc="picking.name"/>
</div>

<br/>

<table class="table table-bordered" style="width:100%; border: 1px solid black;">
<thead>
<tr>
<th style="width:50%">Número</th>
<th style="width:50%">Fecha</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center;">
<t t-esc="numero"/>
de <t t-if="picking.number_of_packages == 0">1</t>
<t t-else="">
<t t-esc="picking.number_of_packages"/>
</t>
</td>
<td style="text-align:center;">
<t t-esc="picking.date_done" t-options="{'widget': 'date'}"/>
</td>
</tr>
</tbody>
</table>
</div>
<!--Fin pie-->


</t>
</t>
</t>
</t>
</template>

<template id="stock_batch_picking_ux.custom_barcode_transfer_template_view_zpl">
<t t-set="numero" t-value="0"/>
<t t-as="l" t-foreach="docs">
<t t-as="o" t-foreach="l.move_line_ids.filtered(lambda v: v.product_id.uom_id.id == 1)">
<t t-as="i" t-foreach="range(0,int(o.qty_done))">
<t t-set="numero" t-value="numero + 1"/>
<t t-if="numero % 2 != 0 ">
^XA
^CI28
^LH0,0
^FO20,10,0

^FO260,10
^A0N,20,25^FD<t t-esc="l.date_done" t-options="{'widget': 'date'}"/>^FS

^FO20,40
^A0N,40,30
^TBN,360,40
^FD<t t-esc="o.product_id.display_name"/>^FS

^FO20,90
^BY3
^BCN,60,Y,N,N,A
^FD<t t-esc="o.product_id.barcode"/>^FS
</t>
<t t-if="numero % 2 == 0 ">
^FX Nueva etiqueta
^LH445,0
^FO20,10,0
^FO260,10
^A0N,20,25^FD<t t-esc="l.date_done" t-options="{'widget': 'date'}"/>^FS
^FO20,40
^A0N,40,30
^TBN,360,40
^FD<t t-esc="o.product_id.display_name"/>^FS
^FO20,90
^BY3
^BCN,60,Y,N,N,A
^FD<t t-esc="o.product_id.barcode"/>^FS
^XZ
</t>
</t>
</t>
</t>
<t t-if="numero % 2 != 0 "> ^PQ1,0,1,Y^XZ </t>
</template>
</data>
</odoo>