[FIX] stock: fix barcode layout printing

Install stock, go to Configuration>Settings, activate "Storage
Locations". Go to Configuration>Locations select locations and print

The reported will not follow the documentation, barcode will be one
after the other and not side by side, arranged in a 2x2 grid.
Fixing require to apply style changes since new bootstrap
code is not handled well by wkhtmltopdf

opw-2162698

closes odoo/odoo#42967

X-original-commit: 7ac26d0ef5631cee38c29535531053fed6afce85
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2020-01-08 14:56:50 +00:00
committed by Nicolas Martinelli
parent 0d2e280152
commit d3b2ce528c
@@ -10,13 +10,21 @@
<template id="report_location_barcode">
<t t-call="web.html_container">
<div t-foreach="[docs[x:x+4] for x in range(0, len(docs), 4)]" t-as="page_docs" class="page article page_stock_location_barcodes">
<t t-foreach="page_docs" t-as="o">
<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 page_stock_location_barcodes">
<table height="1000">
<t t-foreach="page_docs" t-as="page_row">
<tr>
<t t-foreach="page_row" t-as="o">
<t t-if="o.barcode"><t t-set="content" t-value="o.barcode"/></t>
<t t-if="not o.barcode"><t t-set="content" t-value="o.name"/></t>
<td>
<img class="barcode" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s&amp;humanreadable=1' % ('Code128', content, 600, 100)" alt="Barcode"/>
</td>
</t>
</tr>
</t>
</div>
</table>
</div>
</t>
</template>
</data>