diff --git a/addons/stock/views/report_location_barcode.xml b/addons/stock/views/report_location_barcode.xml index ecb9c4b0a964594de3dc336b0b6b5996d166136e..4ceec98075a6a759ba9ed82ed504b5b49190544e 100644 --- a/addons/stock/views/report_location_barcode.xml +++ b/addons/stock/views/report_location_barcode.xml @@ -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> \ No newline at end of file +</openerp>