Files
odoo_source/addons/stock/report/report_location_barcode.xml
T
Tiffany Chang (tic) 2ed3f2f98b [IMP] stock: align location and picking type barcode reports
Creates a generic barcode template that prints the record name + its
associated barcode (if it exists). Generic template is a combination of
previously existing stock.picking.type and stock.location barcode
reports.

Updates stock.picking.type and stock.location barcode reports such that:
- they have a title (for clarity when combining them in the same pdf)
- they use the same (newly created) generic barcode template for an
  aligned look

Also adds some formatting changes (proper indentation for legibility).

Supports a review comment of overall barcode improvement task

Task: 1884520
Enterprise PR: odoo/enterprise#12086

Closes: odoo/odoo#55096
2020-08-20 15:06:08 +00:00

33 lines
1.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_generic_barcode">
<t t-call="web.html_container">
<div t-foreach="[[docs[x:x+2], docs[x+2:x+4]] for x in range(0, len(docs), 4)]" 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 height="1000">
<t t-foreach="page_docs" t-as="page_row">
<tr>
<t t-foreach="page_row" t-as="o">
<td>
<div style="text-align: center; font-size: 2em"><span t-field="o.name"/></div>
<img t-if="o.barcode" class="barcode" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s&amp;humanreadable=1' % ('Code128', o.barcode, 600, 150)" alt="Barcode"/>
</td>
</t>
</tr>
</t>
</table>
</div>
</t>
</template>
<template id="report_location_barcode">
<t t-set="title">Locations</t>
<t t-call="stock.report_generic_barcode"/>
</template>
</data>
</odoo>