[FIX]refactor package report
authorCedric Snauwaert <csn@openerp.com>
Mon, 17 Mar 2014 09:47:22 +0000 (10:47 +0100)
committerCedric Snauwaert <csn@openerp.com>
Mon, 17 Mar 2014 09:47:22 +0000 (10:47 +0100)
bzr revid: csn@openerp.com-20140317094722-etwze4uvx3wnejfw

addons/stock/__openerp__.py
addons/stock/stock_report.xml
addons/stock/views/report_package_barcode.xml [new file with mode: 0644]

index 20a6ee1..cc4392b 100644 (file)
@@ -88,6 +88,7 @@ Dashboard / Reports for Warehouse Management will include:
         'report/report_stock_view.xml',
         'board_warehouse_view.xml',
         'res_config_view.xml',
+        'views/report_package_barcode.xml',
     ],
     'test': [
         'test/inventory.yml',
index d5a78ef..bc32f14 100644 (file)
@@ -3,7 +3,7 @@
     <data>
         <report auto="False" id="report_product_history" model="product.product" name="stock.product.history" string="Stock Level Forecast"/>
         <report id="report_picking_list" model="stock.picking" name="stock.picking.list.internal" string="Picking Slip" rml="stock/report/picking_internal.rml"/>
-        <report id="report_quant_package_barcode" model="stock.quant.package" name="stock.quant.package.barcode" string="Package BarCode" rml="stock/report/package_barcode.rml"/>
+        <report id="action_report_quant_package_barcode" model="stock.quant.package" report_type="qweb-pdf" name="stock.report_package_barcode" string="Package BarCode" file="stock.report_package_barcode"/>
         <report id="report_picking_list_in" model="stock.pickin" name="stock.picking.list" string="Receipt Slip" rml="stock/report/picking.rml"/>
         <report id="report_picking_list_out" model="stock.picking" name="stock.picking.list" string="Delivery Slip" rml="stock/report/picking.rml"/>
         <report id="report_move_labels" model="stock.move" name="stock.move.label" string="Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/>
diff --git a/addons/stock/views/report_package_barcode.xml b/addons/stock/views/report_package_barcode.xml
new file mode 100644 (file)
index 0000000..841486e
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_package_barcode">
+    <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-8">
+                            <table class="table table-condensed" style="border-bottom: 0px solid white !important;">
+                                <thead>
+                                    <tr>
+                                        <th>Product</th>
+                                        <th class="text-right">Quantity</th>
+                                        <th>Lot</th>
+                                    </tr>
+                                </thead>
+                                <tbody>
+                                    <tr t-foreach="o.quant_ids" t-as="l">
+                                        <td>
+                                           <span  t-field="l.product_id.name"/>
+                                        </td>
+                                        <td class="text-right">
+                                            <span t-field="l.qty"/>
+                                            <span groups="product.group_uom" t-field="l.product_id.uom_id.name"/>
+                                        </td>
+                                        <td>
+                                            <t t-if="l.lot_id"><span t-field="l.lot_id.name"/></t>
+                                        </td>
+                                    </tr>
+                                </tbody>
+                            </table>
+                        </div>
+                        <div class="col-xs-4">
+                            <img class="image" t-att-src="'data:image/png;base64,%s' % res_company.logo" style="border:auto;"/>
+                        </div>
+                    </div>
+                    <div class="row">
+                        <div class="col-xs-12 mt32">
+                            <table class="table table-condensed" style="border-bottom: 3px solid black !important;"><thead><th> </th></thead></table>
+                            <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Standard39', o.name, 800, 40)" style="width:100%;"/>
+                            <p class="text-center" t-field="o.name"></p>
+                        </div>
+                    </div>
+                </div>
+            </t>
+        </t>
+    </t>
+</template>
+</data>
+</openerp>