[IMP]:stock:Packing List Report.

* pdf title should be "packing list"
 * invert the quantity and location columns
 * add a total row as last line that sums the quantity

bzr revid: apa@tinyerp.com-20101110082404-qmio81f8y1yvgls3
This commit is contained in:
apa-tiny 2010-11-10 13:54:04 +05:30
parent 870253eb23
commit 4d9d04ee75
3 changed files with 44 additions and 16 deletions

View File

@ -29,7 +29,13 @@ class picking(report_sxw.rml_parse):
super(picking, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'get_qtytotal':self._get_qtytotal
})
def _get_qtytotal(self,move_lines):
total=0.0
for move in move_lines:
total+=move.product_qty
return total
report_sxw.report_sxw('report.stock.picking.list','stock.picking','addons/stock/report/picking.rml',parser=picking)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Picking List" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<document filename="Packing List.pdf">
<template pageSize="(595.0,842.0)" title="Packing List" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="0.0" y1="57.0" width="538" height="728"/>
</pageTemplate>
@ -70,7 +70,7 @@
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Move_Line_Content_Other_State">
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
@ -79,6 +79,12 @@
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
@ -203,13 +209,13 @@
<para style="terp_tblheader_Details_Centre">Lot</para>
</td>
<td>
<para style="terp_tblheader_Details">State</para>
<para style="terp_tblheader_Details_Centre">State</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Quantity</para>
<para style="terp_tblheader_Details_Right">Location</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Location</para>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
</tr>
</blockTable>
@ -228,19 +234,20 @@
<para style="terp_default_9">[[ move_lines.state ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_lines.product_qty ]] [[ move_lines.product_uom.name ]] </para>
<para style="terp_default_Right_9">[[ (move_lines.location_id and move_lines.location_id.name) or '' ]] </para>
</td>
<td>
<para style="terp_default_Centre_9">[[ (move_lines.location_id and move_lines.location_id.name) or '' ]]</para>
<para style="terp_default_Right_9">[[ move_lines.product_qty ]] [[ move_lines.product_uom.name ]]</para>
</td>
</tr>
</blockTable>
</section>
<para style="terp_default_Bold_9">[[ ([line for line in picking.move_lines if (line.state == 'draft' or line.state=='waiting' )]) and 'Non Assigned Products:' or removeParentNode('para') ]]</para>
<para style="terp_default_2"/>
<section>
<para style="terp_default_2">[[ repeatIn([line for line in picking.move_lines if (line.state == 'draft' or line.state=='waiting')],'move_lines') ]] </para>
<para style="terp_default_2">[[ repeatIn([line for line in picking.move_lines if (line.state == 'draft' or line.state=='waiting')],'move_lines') ]]</para>
<para style="terp_default_2">[[ (picking.move_lines!=[] and removeParentNode('para')) or removeParentNode('section')]]</para>
<blockTable colWidths="256.0,74.0,57.0,61.0,72.0" style="Move_Line_Content_Other_State">
<blockTable colWidths="256.0,74.0,57.0,61.0,72.0" style="Table1">
<tr>
<td>
<para style="terp_default_9"><font face="Helvetica" size="9.0">[ [[ (move_lines.product_id.default_code) or removeParentNode('font') ]] ]</font> [[ move_lines.product_id.name ]] [[ move_lines.product_id.variants or '']]</para>
@ -252,16 +259,31 @@
<para style="terp_default_9">[[ move_lines.state ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_lines.product_qty ]] [[ move_lines.product_uom.name ]] </para>
<para style="terp_default_Right_9">[[ (move_lines.location_id and move_lines.location_id.name) or '' ]] </para>
</td>
<td>
<para style="terp_default_Centre_9">[[ (move_lines.location_id and move_lines.location_id.name) or '' ]]</para>
<para style="terp_default_Right_9">[[ move_lines.product_qty ]] [[ move_lines.product_uom.name ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
</section>
<blockTable colWidths="388.0,55.0,77.0" style="Table2">
<tr>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Total</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(get_qtytotal(picking.move_lines), digits=get_digits(dp='Product UoM')) ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
</story>
</document>

View File

@ -2,7 +2,7 @@
<openerp>
<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" string="Picking list" rml="stock/report/picking.rml"/>
<report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Packing list" 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"/>
<report auto="False" id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Inventory Overview" rml="stock/report/lot_overview.rml" groups="base.group_extended"/>
<report id="report_location_overview_all" model="stock.location" name="lot.stock.overview_all" string="Inventory (with child locations)" rml="stock/report/lot_overview_all.rml"/>