[IMP] Improve report with bar codes and only moves or pack ops visible

bzr revid: jco@openerp.com-20140317100115-lbey08ms0480px2x
This commit is contained in:
Josse Colpaert 2014-03-17 11:01:15 +01:00
parent 6dbb3a86db
commit 3791a37646
3 changed files with 28 additions and 14 deletions

View File

@ -480,7 +480,7 @@ class Report(http.Controller):
try:
width, height = int(width), int(height)
barcode = createBarcodeDrawing(
type, value=value, format='png', width=width, height=height
type, value=value, format='png', width=width, height=height, humanReadable=True
)
barcode = barcode.asString('png')
except (ValueError, AttributeError):

View File

@ -239,7 +239,6 @@ class report(osv.Model):
action = {
'type': 'ir.actions.report.xml',
'ids': ids,
'report_name': report.report_name,
'report_type': report.report_type,
'report_file': report.report_file,

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_picking">
<template id="report_picking">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
@ -28,11 +28,12 @@
<span t-field="o.picking_type_id"/>:
<span t-field="o.name"/>
</h2>
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Order (Origin)</strong></th>
<th><strong>State</strong></th>
<th><strong>Commitment Date</strong></th>
<th><strong>Scheduled Date</strong></th>
</tr>
</thead>
@ -41,16 +42,21 @@
<td>
<span t-field="o.origin"/>
</td>
<td>
<span t-field="o.state"/>
</td>
<td>
<span t-field="o.date"/>
</td>
<td>
<span t-field="o.min_date"/>
</td>
</tr>
</tbody>
</table>
<h3>Quantities Demanded</h3>
<table class="table table-condensed">
</table>
<br/>
<br/>
<table class="table table-condensed" t-if="not o.pack_operation_ids">
<tr t-foreach="o.move_lines" t-as="move">
<td><span t-field="move.product_id"/></td>
<td><span t-field="move.product_uom_qty"/> <span t-field="move.product_uom" groups="product.group_uom"/></td>
@ -58,9 +64,7 @@
<td><span t-field="move.location_dest_id"/></td>
</tr>
</table>
<div t-if="o.pack_operation_ids">
<h3>Quantities Chosen</h3>
<table class="table table-condensed">
<table class="table table-condensed" t-if="o.pack_operation_ids">
<tr t-foreach="o.pack_operation_ids" t-as="pack_operation">
<td><span t-field="pack_operation.product_id"/></td>
<td><span t-field="pack_operation.product_qty"/> <span t-field="pack_operation.product_uom_id" groups="product.group_uom"/></td>
@ -70,13 +74,24 @@
<span t-if="pack_operation.lot_id">:</span>
<span t-field="pack_operation.lot_id"/>
</td>
<td>
<span t-if="pack_operation.lot_id">
<img t-att-src="'/report/barcode/Standard39/%s' % pack_operation.lot_id"/>
</span>
<span t-if="pack_operation.product_id and not pack_operation.lot_id and pack_operation.product_id.ean13">
<img t-att-src="'/report/barcode/EAN13/%s' % pack_operation.product_id.ean13"/>
</span>
<span t-if="pack_operation.package_id and not pack_operation.product_id">
<span t-field = "pack_operation.package_id.name"/>
<img t-att-src="'/report/barcode/Standard39/%s' % pack_operation.package_id.name"/>
</span>
</td>
<td><span t-field="pack_operation.location_dest_id"/>
<span t-if="pack_operation.result_package_id">:</span>
<span t-field="pack_operation.result_package_id"/>
</td>
</td>
</tr>
</table>
</div>
</div>
</t>
</t>