summaryrefslogtreecommitdiff
path: root/addons/stock/report/report_location_barcode.xml
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/stock/report/report_location_barcode.xml
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/stock/report/report_location_barcode.xml')
-rw-r--r--addons/stock/report/report_location_barcode.xml41
1 files changed, 41 insertions, 0 deletions
diff --git a/addons/stock/report/report_location_barcode.xml b/addons/stock/report/report_location_barcode.xml
new file mode 100644
index 00000000..36493b05
--- /dev/null
+++ b/addons/stock/report/report_location_barcode.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+<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 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>
+ <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, 400, 100)" 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>