summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Henrotin <whe@odoo.com>2018-09-19 10:05:29 +0200
committerWilliam Henrotin <whe@odoo.com>2018-09-20 14:47:06 +0200
commit009e1ab4b6198a0f048a08d5c98d7c4fe2b2e8dc (patch)
tree06e4fd41b6ff4a32a38ed1be9818b6a01c87bfd1
parentcdbd33b6f38743d9ea222baf69c520dd50f382e6 (diff)
[IMP] stock, stock_zebra: add label on picking type
This commit adds the posibility to print labels containing the barcode of a picking type. There are two available formats : pdf or zpl
-rw-r--r--addons/stock/report/report_stockpicking_operations.xml25
-rw-r--r--addons/stock/report/stock_report_views.xml9
-rw-r--r--addons/stock_zebra/report/picking_templates.xml16
-rw-r--r--addons/stock_zebra/report/stock_reports.xml7
4 files changed, 57 insertions, 0 deletions
diff --git a/addons/stock/report/report_stockpicking_operations.xml b/addons/stock/report/report_stockpicking_operations.xml
index de02f3868a2..63bfbd8cc14 100644
--- a/addons/stock/report/report_stockpicking_operations.xml
+++ b/addons/stock/report/report_stockpicking_operations.xml
@@ -164,5 +164,30 @@
</t>
</t>
</template>
+ <template id="report_picking_type_label">
+ <t t-call="web.basic_layout">
+ <t t-foreach="docs" t-as="o">
+ <div class="page">
+ <div class="oe_structure"/>
+ <div class="row">
+ <div class="col-8">
+ <table class="table table-condensed" style="border-bottom: 0px solid white !important;width: 3in;">
+ <tr>
+ <th style="text-align: left;">
+ <span t-field="o.name"/>
+ </th>
+ </tr>
+ <tr>
+ <td style="text-align: center; vertical-align: middle;" class="col-5">
+ <img t-if="o.barcode" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.barcode, 600, 150)" style="width:100%;height:20%;"/>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ </t>
+ </t>
+ </template>
</data>
</odoo>
diff --git a/addons/stock/report/stock_report_views.xml b/addons/stock/report/stock_report_views.xml
index 8a4c845d188..5d1fb31fd32 100644
--- a/addons/stock/report/stock_report_views.xml
+++ b/addons/stock/report/stock_report_views.xml
@@ -61,6 +61,15 @@
print_report_name="'Lot-Serial - %s' % object.name"
/>
<report
+ string="Operation type (PDF)"
+ id="action_report_picking_type_label"
+ model="stock.picking.type"
+ report_type="qweb-pdf"
+ name="stock.report_picking_type_label"
+ file="stock.report_picking_type_label"
+ print_report_name="'Operation-type - %s' % object.name"
+ />
+ <report
id="action_report_stock_rule"
model="product.template"
string="Product Routes Report"
diff --git a/addons/stock_zebra/report/picking_templates.xml b/addons/stock_zebra/report/picking_templates.xml
index dc9aba228fd..8d135dd0c40 100644
--- a/addons/stock_zebra/report/picking_templates.xml
+++ b/addons/stock_zebra/report/picking_templates.xml
@@ -35,5 +35,21 @@
</t>
</t>
</template>
+
+ <template id="label_picking_type_view">
+ <t t-foreach="docs" t-as="operation">
+ <t t-translation="off">
+^XA
+^FO100,50
+^A0N,44,33^FD<t t-esc="operation.name"/>^FS
+<t t-if="operation.barcode">
+^FO100,100
+^BCN,100,Y,N,N
+^FD<t t-esc="operation.barcode"/>^FS
+</t>
+^XZ
+ </t>
+ </t>
+ </template>
</data>
</odoo>
diff --git a/addons/stock_zebra/report/stock_reports.xml b/addons/stock_zebra/report/stock_reports.xml
index c9f038bb651..b5314854d4b 100644
--- a/addons/stock_zebra/report/stock_reports.xml
+++ b/addons/stock_zebra/report/stock_reports.xml
@@ -57,5 +57,12 @@
file="stock_zebra.label_product_packaging_view"
report_type="qweb-text"
/>
+ <report id="label_picking_type"
+ model="stock.picking.type"
+ string="Operation type (ZPL)"
+ name="stock_zebra.label_picking_type_view"
+ file="stock_zebra.label_picking_type_view"
+ report_type="qweb-text"
+ />
</data>
</odoo>