[ADD] stock: add new report for package that only show package barcode
authorCedric Snauwaert <csn@openerp.com>
Wed, 20 Aug 2014 13:30:56 +0000 (15:30 +0200)
committerCedric Snauwaert <csn@openerp.com>
Wed, 20 Aug 2014 13:33:08 +0000 (15:33 +0200)
addons/stock/stock.py
addons/stock/stock_report.xml
addons/stock/views/report_package_barcode.xml

index 87bc245..4c96986 100644 (file)
@@ -3620,7 +3620,7 @@ class stock_package(osv.osv):
 
     def action_print(self, cr, uid, ids, context=None):
         context = dict(context or {}, active_ids=ids)
-        return self.pool.get("report").get_action(cr, uid, ids, 'stock.report_package_barcode', context=context)
+        return self.pool.get("report").get_action(cr, uid, ids, 'stock.report_package_barcode_small', context=context)
     
     
     def unpack(self, cr, uid, ids, context=None):
index e88aa04..a54b914 100644 (file)
@@ -19,7 +19,8 @@
             file="stock.report_inventory" 
         />
         <report auto="False" id="report_product_history" model="product.product" name="stock.product.history" string="Stock Level Forecast"/>
-        <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="action_report_quant_package_barcode" model="stock.quant.package" report_type="qweb-pdf" name="stock.report_package_barcode" string="Package BarCode with Contents" file="stock.report_package_barcode"/>
+        <report id="action_report_quant_package_barcode_small" model="stock.quant.package" report_type="qweb-pdf" name="stock.report_package_barcode_small" string="Package BarCode" file="stock.report_package_barcode"/>
         <report id="action_report_location_barcode" model="stock.location" report_type="qweb-pdf" name="stock.report_location_barcode" string="Location BarCode" file="stock.report_location_barcode"/>
         <report id="action_report_lot_barcode" model="stock.production.lot" report_type="qweb-pdf" name="stock.report_lot_barcode" string="Lot BarCode" file="stock.report_lot_barcode"/>
     </data>
index 330dcd9..310eb36 100644 (file)
                         </div>
                     </div>
                     <div class="row">
-                        <div class="col-xs-12 mt32">
+                        <div class="col-xs-12 mt32 text-center">
                             <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' % ('Code128', o.name, 600, 100)" style="width:300px;height:50px"/>
-                            <p class="text-center" t-field="o.name"></p>
+                            <p t-field="o.name"></p>
+                        </div>
+                    </div>
+                </div>
+            </t>
+        </t>
+    </t>
+</template>
+
+<template id="report_package_barcode_small">
+    <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-12 mt32 text-center">
+                            <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' % ('Code128', o.name, 600, 100)" style="width:300px;height:50px"/>
+                            <p t-field="o.name"></p>
                         </div>
                     </div>
                 </div>