[ADD] stock: add new report for package that only show package barcode

This commit is contained in:
Cedric Snauwaert 2014-08-20 15:30:56 +02:00
parent d421f9a365
commit 6e201cdcdb
3 changed files with 24 additions and 4 deletions

View 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):

View 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>

View File

@ -38,10 +38,29 @@
</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>