[IMP] stock: report to print locations barcodes
Print 4 barcodes per page, in a disposition that is practical to print on stickers.
This commit is contained in:
@@ -2,26 +2,43 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<template id="report_location_barcode">
|
||||
<style type="text/css">
|
||||
.barcode {
|
||||
position: absolute;
|
||||
-webkit-transform: rotate(90deg);
|
||||
width: 300px;
|
||||
margin-left: -150px;
|
||||
height: 50px;
|
||||
margin-top: -25px;
|
||||
}
|
||||
.barcode:nth-child(1) {
|
||||
top: 47mm;
|
||||
left: 75%;
|
||||
}
|
||||
.barcode:nth-child(2) {
|
||||
top: 161mm;
|
||||
left: 75%;
|
||||
}
|
||||
.barcode:nth-child(3) {
|
||||
top: 47mm;
|
||||
left: 25%;
|
||||
}
|
||||
.barcode:nth-child(4) {
|
||||
top: 161mm;
|
||||
left: 25%;
|
||||
}
|
||||
</style>
|
||||
<t t-call="report.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t>
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 mt6">
|
||||
<table class="table table-condensed" style="border-bottom: 3px solid black !important;"><thead><th> </th></thead></table>
|
||||
<img t-if="not o.barcode" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', o.name, 600, 100)" style="width:300px;height:50px"/>
|
||||
<img t-if="o.barcode" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', o.barcode, 600, 100)" style="width:300px;height:50px"/>
|
||||
<p>
|
||||
<span t-if="not o.barcode" t-field="o.name"/>
|
||||
<span t-if="o.barcode" t-field="o.barcode"/>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-foreach="[docs[x:x+4] for x in xrange(0, len(docs), 4)]" t-as="page_docs">
|
||||
<div class="page">
|
||||
<t t-foreach="page_docs" 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>
|
||||
<img class="barcode" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s&humanreadable=1' % ('Code128', content, 600, 100)"/>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user