Skip to content

Commit

Permalink
[FIX] label_transfer_template
Browse files Browse the repository at this point in the history
  • Loading branch information
mav-adhoc committed Nov 21, 2024
1 parent 1285633 commit 79b70ae
Show file tree
Hide file tree
Showing 8 changed files with 357 additions and 345 deletions.
39 changes: 0 additions & 39 deletions stock_ux/report/ir.action.reports.xml
Original file line number Diff line number Diff line change
@@ -1,43 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="label_10x15" model="report.paperformat">
<field name="name">Etiqueta de despacho(10x15)</field>
<field name="default" eval="True"/>
<field name="format">custom</field>
<field name="page_height">150</field>
<field name="page_width">100</field>
<field name="orientation">Portrait</field>
<field name="margin_top">5</field>
<field name="margin_bottom">5</field>
<field name="margin_left">5</field>
<field name="margin_right">5</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">20</field>
<field name="dpi">90</field>
</record>

<record id="action_custom_label_transfer_template_zpl" model="ir.actions.report">
<field name="name">Etiqueta de despacho (ZPL)</field>
<field name="model">stock.picking</field>
<field name="binding_model_id" ref="stock.model_stock_picking"/>
<field name="report_type">qweb-text</field>
<field name="report_name">stock_ux.custom_label_transfer_template_view_zpl</field>
<field name="report_file">stock_ux.custom_label_transfer_template_view_zpl</field>
<field name="binding_type">report</field>
</record>

<record id="action_custom_label_transfer_template_view_pdf" model="ir.actions.report">
<field name="name">Etiqueta de despacho (PDF)</field>
<field name="model">stock.picking</field>
<field name="binding_model_id" ref="stock.model_stock_picking"/>
<field name="report_type">qweb-pdf</field>
<field name="report_name">stock_ux.custom_label_transfer_template_view_pdf</field>
<field name="report_file">stock_ux.custom_label_transfer_template_view_pdf</field>
<field name="binding_type">report</field>
<field name="paperformat_id" ref="stock_ux.label_10x15"/>
</record>

<record id="action_custom_barcode_transfer_template_view_pdf" model="ir.actions.report">
<field name="name">Etiquetas de Productos del picking (ZPL)</field>
<field name="model">stock.picking</field>
Expand All @@ -48,4 +10,3 @@
<field name="binding_type">report</field>
</record>
</odoo>

305 changes: 0 additions & 305 deletions stock_ux/report/picking_templates.xml
Original file line number Diff line number Diff line change
@@ -1,311 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="stock_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.company_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_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.company_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_ux.custom_barcode_transfer_template_view_zpl">
<t t-set="numero" t-value="0"/>
Expand Down
5 changes: 4 additions & 1 deletion stock_voucher/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Stock Voucher',
'version': "17.0.1.1.0",
'version': "17.0.1.2.0",
'category': 'Warehouse Management',
'sequence': 14,
'summary': '',
Expand All @@ -37,6 +37,7 @@
'security/stock_voucher_security.xml',
'security/ir.model.access.csv',
'wizards/stock_print_stock_voucher_views.xml',
'wizards/stock_picking_wizard_views.xml',
'views/stock_book_views.xml',
'views/stock_picking_voucher_views.xml',
'views/stock_picking_type_views.xml',
Expand All @@ -45,6 +46,8 @@
'data/ir_sequence_data.xml',
'data/stock_book_data.xml',
'report/stock_report_views.xml',
'report/ir.action.reports.xml',
'report/picking_templates.xml',
],
'demo': [
],
Expand Down
Loading

0 comments on commit 79b70ae

Please sign in to comment.