[FIX] stock: allow modification of stock.picking.{in,out} reports via report designer
authorChristophe Simonis <chs@openerp.com>
Fri, 23 Aug 2013 13:12:14 +0000 (15:12 +0200)
committerChristophe Simonis <chs@openerp.com>
Fri, 23 Aug 2013 13:12:14 +0000 (15:12 +0200)
bzr revid: chs@openerp.com-20130823131214-ipouwtnz8r16mlvv

addons/stock/report/picking.py
addons/stock/stock_report.xml

index a33ec28..603e815 100644 (file)
 
 import time
 from openerp.report import report_sxw
-from openerp.osv import osv
-from openerp import pooler
 
 class picking(report_sxw.rml_parse):
     def __init__(self, cr, uid, name, context):
         super(picking, self).__init__(cr, uid, name, context=context)
         self.localcontext.update({
             'time': time,
-            'get_product_desc':self.get_product_desc
+            'get_product_desc': self.get_product_desc,
         })
-    def get_product_desc(self,move_line):
+    def get_product_desc(self, move_line):
         desc = move_line.product_id.name
         if move_line.product_id.default_code:
             desc = '[' + move_line.product_id.default_code + ']' + ' ' + desc
         return desc
 
-report_sxw.report_sxw('report.stock.picking.list','stock.picking','addons/stock/report/picking.rml',parser=picking)
+for suffix in ['', '.in', '.out']:
+    report_sxw.report_sxw('report.stock.picking.list' + suffix,
+                          'stock.picking' + suffix,
+                          'addons/stock/report/picking.rml',
+                          parser=picking)
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 540e6a8..53b89dc 100644 (file)
@@ -3,8 +3,8 @@
     <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 Slip" rml="stock/report/picking.rml"/>
-        <report id="report_picking_list_in" model="stock.picking.in" name="stock.picking.list" string="Receipt Slip" rml="stock/report/picking.rml"/>
-        <report id="report_picking_list_out" model="stock.picking.out" name="stock.picking.list" string="Delivery Slip" rml="stock/report/picking.rml"/>
+        <report id="report_picking_list_in" model="stock.picking.in" name="stock.picking.list.in" string="Receipt Slip" rml="stock/report/picking.rml"/>
+        <report id="report_picking_list_out" model="stock.picking.out" name="stock.picking.list.out" 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"/>
         <report auto="False"  id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Inventory Overview" rml="stock/report/lot_overview.rml"/>
         <report id="report_location_overview_all" model="stock.location" name="lot.stock.overview_all" string="Location Content" rml="stock/report/lot_overview_all.rml"/>