[IMP] stock: print report in 4x7 layout for both the operations

Currently, Storage locations and Operations type barcode are printing in 8x3 layout.

So in this commit, I have changed Report of Storage locations and Operations type
barcode print into 4x7.

TaskID - 2579195

closes odoo/odoo#116844

Related: odoo/enterprise#38901
Signed-off-by: Steve Van Essche <svs@odoo.com>
This commit is contained in:
Tejas Modi
2023-06-14 10:53:51 +02:00
parent e6dd94aa21
commit 280f3de900
2 changed files with 32 additions and 25 deletions
+30 -25
View File
@@ -3,33 +3,38 @@
<data>
<template id="report_generic_barcode">
<t t-call="web.html_container">
<t t-set='nRows' t-value='8'/>
<t t-set='nCols' t-value='3'/>
<div t-foreach="[docs[x:x + nRows * nCols] for x in range(0, len(docs), nRows * nCols)]" t-as="page_docs" class="page article">
<t t-if="title">
<h2 style="text-align: center; font-size: 3em"><t t-esc="title"/></h2>
</t>
<table>
<t t-foreach="range(nRows)" t-as="row">
<tr>
<t t-foreach="range(nCols)" t-as="col">
<t t-set="barcode_index" t-value="(row * nCols + col)"/>
<t t-if="barcode_index &lt; len(page_docs)">
<t t-set="o" t-value="page_docs[barcode_index]"/>
<t t-call="web.basic_layout">
<t t-call="web.html_container">
<t t-set="nRows" t-value="7"/>
<t t-set="nCols" t-value="4"/>
<t t-foreach="[docs[x:x + nRows * nCols] for x in range(0, len(docs), nRows * nCols)]" t-as="page_docs">
<div class="o_label_sheet" style="padding: 10mm 3mm;">
<table class="my-0 table table-sm table-borderless">
<t t-foreach="range(nRows)" t-as="row">
<tr>
<t t-foreach="range(nCols)" t-as="col">
<t t-set="barcode_index" t-value="(row * nCols + col)"/>
<t t-if="barcode_index &lt; len(page_docs)">
<t t-set="o" t-value="page_docs[barcode_index]"/>
<td>
<div class="o_label_full" style="width:47mm;height:37.1mm;border: 1px solid black;">
<div class="o_label_name text-center">
<strong t-field="o.name"/>
</div>
<div class="text-center mt-3">
<div t-if="o.barcode" t-field="o.barcode" style="padding:0"
t-options="{'widget': 'barcode', 'humanreadable': 1, 'symbology': 'auto', 'img_style': 'width:47mm;height:11mm'}"/>
</div>
</div>
</td>
</t>
</t>
</tr>
</t>
<t t-else="">
<t t-set="o" t-value="page_docs[0]"/>
</t>
<td t-att-style="barcode_index &gt;= len(page_docs) and 'visibility:hidden'">
<div style="text-align: center; font-size: 2em"><span t-esc="o.name"/></div>
<div t-if="o.barcode" t-field="o.barcode" t-options="{'widget': 'barcode', 'humanreadable': 1, 'width': 400, 'height': 100}"/>
</td>
</t>
</tr>
</table>
</div>
</t>
</table>
</div>
</t>
</t>
</template>
@@ -66,6 +66,7 @@
<field name="report_type">qweb-pdf</field>
<field name="report_name">stock.report_location_barcode</field>
<field name="report_file">stock.report_location_barcode</field>
<field name="paperformat_id" ref="product.paperformat_label_sheet"/>
<field name="print_report_name">'Location - %s' % object.name</field>
<field name="binding_model_id" ref="model_stock_location"/>
<field name="binding_type">report</field>
@@ -87,6 +88,7 @@
<field name="report_type">qweb-pdf</field>
<field name="report_name">stock.report_picking_type_label</field>
<field name="report_file">stock.report_picking_type_label</field>
<field name="paperformat_id" ref="product.paperformat_label_sheet"/>
<field name="print_report_name">'Operation-type - %s' % object.name</field>
<field name="binding_model_id" ref="model_stock_picking_type"/>
<field name="binding_type">report</field>