improved stock reports: continued.....
authorNaresh Choksy <nch@tinyerp.com>
Wed, 27 May 2009 13:42:15 +0000 (19:12 +0530)
committerNaresh Choksy <nch@tinyerp.com>
Wed, 27 May 2009 13:42:15 +0000 (19:12 +0530)
bzr revid: nch@tinyerp.com-20090527134215-kz7nmyv4em9ydsby

14 files changed:
addons/stock/report/__init__.py
addons/stock/report/lot_location.py
addons/stock/report/lot_location.rml
addons/stock/report/lot_overview.py [new file with mode: 0644]
addons/stock/report/lot_overview.rml [new file with mode: 0644]
addons/stock/report/lot_overview.xml [deleted file]
addons/stock/report/lot_overview.xsl [deleted file]
addons/stock/report/lot_overview_all.py [new file with mode: 0644]
addons/stock/report/lot_overview_all.rml [new file with mode: 0644]
addons/stock/report/lot_overview_all.xml [deleted file]
addons/stock/report/lot_overview_all.xsl [deleted file]
addons/stock/report/picking.rml
addons/stock/stock.py
addons/stock/stock_report.xml

index 9bddb18..f69fc03 100644 (file)
@@ -25,6 +25,8 @@ import product_stock
 import lot_location
 import ups
 import picking
+import lot_overview
+import lot_overview_all
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
index 931ddd9..11d44c0 100644 (file)
@@ -1,7 +1,7 @@
 # -*- encoding: utf-8 -*-
 ##############################################################################
 #
-#    OpenERP, Open Source Management Solution  
+#    OpenERP, Open Source Management Solution
 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
 #    $Id$
 #
@@ -26,16 +26,20 @@ from report import report_sxw
 class lot_location(report_sxw.rml_parse):
     def __init__(self, cr, uid, name, context):
         super(lot_location, self).__init__(cr, uid, name, context)
+        self.quantity_total=0.0
+        self.grand_total=0.0
+
         self.localcontext.update({
             'time': time,
             'process':self.process,
+            'qty_total':self._qty_total,
         })
 
     def process(self,location_id):
         res = {}
         location_obj = pooler.get_pool(self.cr.dbname).get('stock.location')
         product_obj = pooler.get_pool(self.cr.dbname).get('product.product')
-
+        self.quantity_total=0.0
         res['location_name'] = pooler.get_pool(self.cr.dbname).get('stock.location').read(self.cr, self.uid, [location_id],['name'])[0]['name']
 
         prod_info = location_obj._product_get(self.cr, self.uid, location_id)
@@ -43,17 +47,23 @@ class lot_location(report_sxw.rml_parse):
         res['product'] = []
         for prod in product_obj.browse(self.cr, self.uid, prod_info.keys()):
             if prod_info[prod.id]:
-                res['product'].append({'prod_name': prod.name, 'prod_qty': prod_info[prod.id]})
+                res['product'].append({'prod_name': prod.name, 'prod_qty': str(prod_info[prod.id])})
+                self.quantity_total+=prod_info[prod.id]
+                self.grand_total+=prod_info[prod.id]
         if not res['product']:
             res['product'].append({'prod_name': '', 'prod_qty': ''})
         location_child = location_obj.read(self.cr, self.uid, [location_id], ['child_ids'])
+        res['total'] = self.quantity_total
         list=[]
         list.append(res)
+
         for child_id in location_child[0]['child_ids']:
                 list.extend(self.process(child_id))
-
         return list
 
+    def _qty_total(self):
+        return str( self.grand_total)
+
 report_sxw.report_sxw('report.lot.location', 'stock.location', 'addons/stock/report/lot_location.rml', parser=lot_location)
 
 
index abf27ec..cbecbfe 100644 (file)
@@ -1,3 +1,118 @@
 <?xml version="1.0"?>
-<document filename="test.pdf"><template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20"><pageTemplate id="first"><frame id="first" x1="34.0" y1="28.0" width="527" height="786"/></pageTemplate></template><stylesheet><blockTableStyle id="Standard_Outline"><blockAlignment value="LEFT"/><blockValign value="TOP"/></blockTableStyle><blockTableStyle id="Table1"><blockAlignment value="LEFT"/><blockValign value="TOP"/><lineStyle kind="GRID" colorName="black"/><blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/><blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/><blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/></blockTableStyle><blockTableStyle id="Table4"><blockAlignment value="LEFT"/><blockValign value="TOP"/></blockTableStyle><initialize><paraStyle name="all" alignment="justify"/></initialize><paraStyle name="P1" fontName="Times-Roman" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P2" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P3" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P4" fontName="Times-BoldItalic" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P5" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P6" fontName="Times-Roman" fontSize="6.0" leading="8"/><paraStyle name="P7" fontName="Times-Roman" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P8" fontName="Times-BoldItalic" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P9" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P10" fontName="Times-Bold" fontSize="14.0" leading="17" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P11" fontName="Times-BoldItalic" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P12" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P13" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="Standard" fontName="Times-Roman"/><paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/><paraStyle name="Index" fontName="Times-Roman"/></stylesheet><images/><story><para style="P1"><font color="white"> </font></para><section><blockTable colWidths="201.0,235.0,91.0" repeatRows="1" style="Table1"><tr><td><para style="Table Contents">Location</para></td><td><para style="Table Contents">Product</para></td><td><para style="Table Contents">Quantity</para></td></tr></blockTable><para style="P7">[[ repeatIn(objects,'o') ]]</para><section><para style="P4">[[ repeatIn(process(o.id),'ob') ]]</para><para style="P10">[[ ob ['location_name'] ]]</para><blockTable colWidths="202.0,234.0,92.0" repeatRows="1" style="Table4"><tr><td><para style="P2"><font color="white"> </font></para></td><td><para style="P2">[[ repeatIn(ob['product'], 'p') ]]</para><para style="P2">[[ p['prod_name'] ]]</para></td><td><para style="P5">[[ p['prod_qty'] ]]</para></td></tr></blockTable><para style="P6"><font color="white"> </font></para></section></section></story></document>
-
+<document filename="test.pdf">
+  <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
+    <pageTemplate id="first">
+      <frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
+    </pageTemplate>
+  </template>
+  <stylesheet>
+    <blockTableStyle id="Standard_Outline">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table1">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table4">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBELOW" colorName="#d4d4d4" start="0,0" stop="-1,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table2">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table3">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
+      <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>
+    <paraStyle name="P1" fontName="Helvetica-BoldOblique" fontSize="6.0" leading="8"/>
+    <paraStyle name="P2" fontName="Times-Roman"/>
+    <paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="0.0"/>
+    <paraStyle name="P4" fontName="Helvetica-BoldOblique" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P8" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P9" fontName="Helvetica-BoldOblique" fontSize="2.0" leading="3" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Standard" fontName="Times-Roman"/>
+    <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="Index" fontName="Times-Roman"/>
+  </stylesheet>
+  <images/>
+  <story>
+       <para style="P4">[[ repeatIn(objects,'o') ]]</para>
+       <para style="Standard"><font color="white"> </font></para>
+      <section>
+      <blockTable colWidths="201.0,235.0,91.0" repeatRows="1" style="Table1">
+        <tr>
+          <td>
+            <para style="P6">Location</para>
+          </td>
+          <td>
+            <para style="P6">Product</para>
+          </td>
+          <td>
+            <para style="P7">Quantity</para>
+          </td>
+        </tr>
+       </blockTable>
+        <para style="P9">[[ repeatIn(process(o.id),'ob') ]]</para>
+        <blockTable colWidths="202.0,234.0,93.0" repeatRows="1" style="Table4">
+          <tr>
+            <td><para style="P5">[[ ob['location_name'] ]]</para></td>
+            <td><para style="Standard"><font color="white"> </font></para></td>
+            <td><para style="Standard"><font color="white"> </font></para></td>
+          </tr>
+          <tr>
+            <td><para style="P3">[[ repeatIn(ob['product'], 'p') ]] </para></td>
+            <td><para style="P3">[[ p['prod_name'] or 'There is no product in this location' ]]</para></td>
+            <td><para style="P12">[[ p['prod_qty'] or 0.00 ]] </para></td>
+          </tr>
+        </blockTable>
+        <para style="P1"><font color="white"> </font></para>
+        <para style="P1"><font color="white"> </font></para>
+        <blockTable colWidths="200.0,235.0,89.0" style="Table2">
+          <tr>
+            <td><para style="P10"><font color="white"> </font></para></td>
+            <td><para style="P10"></para></td>
+            <td><para style="P10">Total : [[ formatLang(ob['total']) ]]</para></td>
+          </tr>
+          <tr>
+                 <td><para><font color="white"> </font></para></td>
+                 <td><para><font color="white"> </font></para></td>
+                 <td><para><font color="white"> </font></para></td>
+          </tr>
+        </blockTable>
+        </section>
+        <section>
+        <blockTable colWidths="200.0,235.0,89.0" style="Table3">
+          <tr>
+            <td><para style="P10"><font color="white"> </font></para></td>
+            <td><para style="P10"><font color="white"> </font></para></td>
+            <td><para style="P10">Grand Total: [[ qty_total() ]]</para></td>
+          </tr>
+        </blockTable>
+      </section>
+  </story>
+</document>
diff --git a/addons/stock/report/lot_overview.py b/addons/stock/report/lot_overview.py
new file mode 100644 (file)
index 0000000..135c8cf
--- /dev/null
@@ -0,0 +1,85 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution    
+#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+#    $Id$
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import pooler
+import time
+from report import report_sxw
+
+class lot_overview(report_sxw.rml_parse):
+    def __init__(self, cr, uid, name, context):
+        super(lot_overview, self).__init__(cr, uid, name, context)
+        self.price_total = 0.0
+        self.localcontext.update({
+            'time': time,
+            'process':self.process,
+            'price_total': self._price_total,
+        })
+
+    def process(self,location_id):
+        res = {}
+        location_obj = pooler.get_pool(self.cr.dbname).get('stock.location')
+        product_obj = pooler.get_pool(self.cr.dbname).get('product.product')
+       
+        product_ids = product_obj.search(self.cr, self.uid, [])
+
+        products = product_obj.browse(self.cr,self.uid, product_ids)
+        products_by_uom = {}
+        products_by_id = {}
+        for product in products:
+            products_by_uom.setdefault(product.uom_id.id, [])
+            products_by_uom[product.uom_id.id].append(product)
+            products_by_id.setdefault(product.id, [])
+            products_by_id[product.id] = product
+
+        result = []
+#        res['prod'] = []
+        for id in self.ids:
+            for uom_id in products_by_uom.keys():
+                fnc = location_obj._product_get
+                qty = fnc(self.cr, self.uid, id, [x.id for x in products_by_uom[uom_id]])
+                for product_id in qty.keys():
+                    if not qty[product_id]:
+                        continue
+                    product = products_by_id[product_id]
+                    value=(product.standard_price)*(qty[product_id])
+                    self.price_total += value
+                    result.append({
+                        
+                        'name': product.name,
+                        'variants': product.variants or '',
+                        'code': product.default_code,
+                       'amount': str(qty[product_id]),
+                        'uom': product.uom_id.name,
+                        'price': str(product.standard_price),
+                        'value':str(value),
+                    })
+                    
+        
+        return result
+    
+    def _price_total(self):
+            return str( self.price_total)
+
+report_sxw.report_sxw('report.lot.stock.overview', 'stock.location', 'addons/stock/report/lot_overview.rml', parser=lot_overview)
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/stock/report/lot_overview.rml b/addons/stock/report/lot_overview.rml
new file mode 100644 (file)
index 0000000..a2bef2d
--- /dev/null
@@ -0,0 +1,135 @@
+<?xml version="1.0"?>
+<document filename="test.pdf">
+  <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
+    <pageTemplate id="first">
+      <frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
+    </pageTemplate>
+  </template>
+  <stylesheet>
+    <blockTableStyle id="Standard_Outline">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table1">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table2">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+               <lineStyle kind="LINEBELOW" colorName="#d4d4d4" start="0,0" stop="-1,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table4">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
+      <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>
+    <paraStyle name="P1" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P2" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P3" fontName="Helvetica"/>
+    <paraStyle name="P4" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
+    <paraStyle name="P5" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
+    <paraStyle name="P6" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER"/>
+    <paraStyle name="P7" fontName="Helvetica-BoldOblique" fontSize="6.0" leading="8"/>
+    <paraStyle name="P8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P9" fontName="Helvetica-BoldOblique" fontSize="2.0" leading="3" spaceBefore="0.0" spaceAfter="0.0"/>
+    <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+    <paraStyle name="Standard" fontName="Times-Roman"/>
+    <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="Index" fontName="Times-Roman"/>
+    <paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
+  </stylesheet>
+  <images/>
+  <story>
+    <para style="P2">
+      <font color="white"> </font>
+    </para>
+    <section>
+      <blockTable colWidths="182.0,64.0,63.0,60.0,84.0,76.0" repeatRows="1" style="Table1">
+        <tr>
+          <td>
+            <para style="P1">Product</para>
+          </td>
+          <td>
+            <para style="P1">Variants</para>
+          </td>
+          <td>
+            <para style="P10">Quantity</para>
+          </td>
+          <td>
+            <para style="P11">UoM</para>
+          </td>
+          <td>
+            <para style="P10">Unit Price</para>
+          </td>
+          <td>
+            <para style="P10">Value</para>
+          </td>
+        </tr>
+      </blockTable>
+      <para style="P9">[[ repeatIn(objects,'o') ]]</para>
+      <section>
+        <blockTable colWidths="180.0,64.0,63.0,61.0,82.0,76.0" repeatRows="1" style="Table2">
+          <tr>
+            <td>
+              <para style="P12"><font face="Times-Roman">[[ repeatIn(process(o.id),'ob') ]]</font>[[ ob['name'] ]]</para>
+            </td>
+            <td>
+              <para style="P4">[[ ob['variants'] ]]</para>
+            </td>
+            <td>
+              <para style="P5">[[ ob['amount'] ]]</para>
+            </td>
+            <td>
+              <para style="P6">[[ ob['uom'] ]]</para>
+            </td>
+            <td>
+              <para style="P5">[[ ob['price'] ]]</para>
+            </td>
+            <td>
+              <para style="P5">[[ ob['value'] ]]</para>
+            </td>
+          </tr>
+        </blockTable>
+        <para style="P7">
+          <font color="white"> </font>
+        </para>
+        <blockTable colWidths="369.0,82.0,74.0" style="Table4">
+          <tr>
+            <td>
+              <para style="P8">
+                <font color="white"> </font>
+              </para>
+            </td>
+            <td>
+              <para style="P8">Total:</para>
+            </td>
+            <td>
+              <para style="P8">[[ price_total() ]]</para>
+            </td>
+          </tr>
+        </blockTable>
+        <para style="P3">
+          <font color="white"> </font>
+        </para>
+      </section>
+    </section>
+  </story>
+</document>
diff --git a/addons/stock/report/lot_overview.xml b/addons/stock/report/lot_overview.xml
deleted file mode 100644 (file)
index 4fa5680..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<lotlist>
-    <lot type="fields" name="id">
-        <id type="field" name="id"/>
-        <product type="call" name="_product_get_report" args="">
-            <amount value="amount"/>
-            <variants value="variants"/>
-            <name value="name"/>
-            <uom value="uom"/>
-            <price value="price"/>
-        </product>
-    </lot>
-</lotlist>
diff --git a/addons/stock/report/lot_overview.xsl b/addons/stock/report/lot_overview.xsl
deleted file mode 100644 (file)
index 0244bca..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
-
-       <xsl:import href="../../base/report/corporate_defaults.xsl"/>
-       <xsl:import href="../../base/report/rml_template.xsl"/>
-       
-       <xsl:template name="first_page_frames">
-               <frame id="main" x1="1cm" y1="2.5cm" width="19.0cm" height="23cm"/>
-       </xsl:template>
-       
-       <xsl:template match="/">
-               <xsl:call-template name="rml"/>
-       </xsl:template>
-
-       <!-- stylesheet -->
-
-       <xsl:template name="stylesheet">
-               <blockTableStyle id="products">
-                        <blockFont name="Helvetica-Bold" size="10" start="0,0" stop="-1,0"/>
-                        <blockBackground colorName="grey" start="0,0" stop="-1,0"/>
-                        <blockTextColor colorName="white" start="0,0" stop="-1,0"/>
-                        <blockValign value="TOP"/>
-                        <blockAlignment value="CENTER" start="0,0" stop="-1,0"/>
-                        <blockAlignment value="RIGHT" start="1,1" stop="-1,-1"/>
-                        <lineStyle kind="GRID" colorName="black"/>
-               </blockTableStyle>
-       </xsl:template>
-       
-       <xsl:template name="story">
-               <xsl:apply-templates select="lotlist"/>
-       </xsl:template>
-       
-       <xsl:template name="lotlist">
-               <nextFrame/>
-               <setNextTemplate name="other_pages"/>
-               <xsl:apply-templates select="lot"/>
-       </xsl:template>
-       
-       <xsl:template match="lot">
-               
-               <spacer length="1cm"/>
-
-               <blockTable colWidths="8cm,2.5cm,2cm,2cm,2cm,2.5cm" style="products" repeatRows="1">
-                       <tr>
-                               <td t="1">Product</td><td t="1">Variants</td><td t="1">Amount</td><td t="1">UoM</td><td t="1">Unit Price</td><td t="1">Value</td>
-                       </tr>
-                       <xsl:apply-templates select="product"/>
-               </blockTable>
-               
-               <setNextTemplate name="other_pages"/>
-               <pageBreak/>
-<!--
-               <setNextTemplate name="first_page"/>
-               <nextFrame/>
--->
-       </xsl:template>
-       
-       <xsl:template match="product">
-               <tr>
-                       <td><para><xsl:value-of select="name"/></para></td>
-                       <td><para><xsl:value-of select="variants"/></para></td>
-                       <td><xsl:value-of select="amount"/></td>
-                       <td><xsl:value-of select="uom"/></td>
-                       <td><xsl:value-of select="price"/></td>
-                       <td><xsl:value-of select="amount * price"/></td>
-<!--           <td><xsl:value-of select="//product_amount[id=$product_id]/amount"/></td>
-                       <td><xsl:value-of select="//product_amount[id=$product_id]/amount * price"/></td> -->
-               </tr>
-       </xsl:template>
-
-</xsl:stylesheet>
diff --git a/addons/stock/report/lot_overview_all.py b/addons/stock/report/lot_overview_all.py
new file mode 100644 (file)
index 0000000..7c08f01
--- /dev/null
@@ -0,0 +1,85 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution    
+#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+#    $Id$
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import pooler
+import time
+from report import report_sxw
+
+class lot_overview_all(report_sxw.rml_parse):
+    def __init__(self, cr, uid, name, context):
+        super(lot_overview_all, self).__init__(cr, uid, name, context)
+        self.price_total = 0.0
+        self.localcontext.update({
+            'time': time,
+            'process':self.process,
+            'price_total': self._price_total,
+        })
+
+    def process(self,location_id):
+        res = {}
+        location_obj = pooler.get_pool(self.cr.dbname).get('stock.location')
+        product_obj = pooler.get_pool(self.cr.dbname).get('product.product')
+       
+        product_ids = product_obj.search(self.cr, self.uid, [])
+
+        products = product_obj.browse(self.cr,self.uid, product_ids)
+        products_by_uom = {}
+        products_by_id = {}
+        for product in products:
+            products_by_uom.setdefault(product.uom_id.id, [])
+            products_by_uom[product.uom_id.id].append(product)
+            products_by_id.setdefault(product.id, [])
+            products_by_id[product.id] = product
+
+        result = []
+#        res['prod'] = []
+        for id in self.ids:
+            for uom_id in products_by_uom.keys():
+                fnc = location_obj._product_get
+                qty = fnc(self.cr, self.uid, id, [x.id for x in products_by_uom[uom_id]])
+                for product_id in qty.keys():
+                    if not qty[product_id]:
+                        continue
+                    product = products_by_id[product_id]
+                    value=(product.standard_price)*(qty[product_id])
+                    self.price_total += value
+                    result.append({
+                        
+                        'name': product.name,
+                        'variants': product.variants or '',
+                        'code': product.default_code,
+                       'amount': str(qty[product_id]),
+                        'uom': product.uom_id.name,
+                        'price': str(product.standard_price),
+                        'value':str(value),
+                    })
+                    
+        
+        return result
+    
+    def _price_total(self):
+            return str( self.price_total)
+
+report_sxw.report_sxw('report.lot.stock.overview_all', 'stock.location', 'addons/stock/report/lot_overview_all.rml', parser=lot_overview_all)
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/stock/report/lot_overview_all.rml b/addons/stock/report/lot_overview_all.rml
new file mode 100644 (file)
index 0000000..ca137d6
--- /dev/null
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<document filename="test.pdf">
+  <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
+    <pageTemplate id="first">
+      <frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
+    </pageTemplate>
+  </template>
+  <stylesheet>
+    <blockTableStyle id="Standard_Outline">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table1">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table4">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBELOW" colorName="#d4d4d4" start="0,0" stop="-1,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table2">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
+      <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>
+    <paraStyle name="P1" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P2" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P3" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P7" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P8" fontName="Helvetica-BoldOblique" fontSize="2.0" leading="3" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P9" fontName="Helvetica"/>
+    <paraStyle name="P10" fontName="Helvetica-BoldOblique" fontSize="6.0" leading="8"/>
+    <paraStyle name="P11" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P13" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="P14" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Standard" fontName="Times-Roman"/>
+    <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="Index" fontName="Times-Roman"/>
+  </stylesheet>
+  <images/>
+  <story>
+    <para style="P1">
+      <font color="white"> </font>
+    </para>
+    <section>
+      <blockTable colWidths="75.0,158.0,59.0,54.0,51.0,64.0,67.0" repeatRows="1" style="Table1">
+        <tr>
+          <td><para style="P2">Code</para></td>
+          <td><para style="P2">Product</para></td>
+          <td><para style="P2">Variants</para></td>
+          <td><para style="P3">Amount</para></td>
+          <td><para style="P4">UoM</para></td>
+          <td><para style="P3">Unit Price</para></td>
+          <td><para style="P3">Value</para></td>
+        </tr>
+      </blockTable>
+      <para style="P8">[[repeatIn(objects,'o')]]</para>
+      <section>
+        <blockTable colWidths="5.0,69.0,159.0,60.0,54.0,51.0,64.0,67.0" repeatRows="1" style="Table4">
+          <tr>
+            <td><para style="P7"><font color= "white">[[ repeatIn(process(o.id),'ob') ]]</font></para></td>
+            <td><para style="P7">[[ ob['code'] ]]</para></td>
+            <td><para style="P7">[[ ob['name'] ]]</para></td>
+            <td><para style="P11">[[ ob['variants'] ]]</para></td>
+            <td><para style="P12">[[ ob['amount'] ]]</para></td>
+            <td><para style="P13">[[ ob['uom'] ]]</para></td>
+            <td><para style="P12">[[ ob['price'] ]]</para></td>
+            <td><para style="P12">[[ ob['value'] ]]</para></td>
+          </tr>
+        </blockTable>
+        <para style="P10">
+          <font color="white"> </font>
+        </para>
+        <blockTable colWidths="397.0,66.0,63.0" style="Table2">
+          <tr>
+            <td>
+              <para style="P6">
+                <font color="white"> </font>
+              </para>
+            </td>
+            <td><para style="P5">Total :</para></td>
+            <td><para style="P5">[[ price_total() ]]</para></td>
+          </tr>
+        </blockTable>
+        <para style="P9">
+          <font color="white"> </font>
+        </para>
+      </section>
+    </section>
+  </story>
+</document>
diff --git a/addons/stock/report/lot_overview_all.xml b/addons/stock/report/lot_overview_all.xml
deleted file mode 100644 (file)
index a7c1997..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<lotlist>
-    <lot type="fields" name="id">
-        <id type="field" name="id"/>
-        <product type="call" name="_product_get_all_report" args="">
-            <amount value="amount"/>
-            <variants value="variants"/>
-            <name value="name"/>
-            <code value="code"/>
-            <uom value="uom"/>
-            <price value="price"/>
-        </product>
-    </lot>
-</lotlist>
diff --git a/addons/stock/report/lot_overview_all.xsl b/addons/stock/report/lot_overview_all.xsl
deleted file mode 100644 (file)
index c78b8f6..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
-
-       <xsl:import href="../../base/report/corporate_defaults.xsl"/>
-       <xsl:import href="../../base/report/rml_template.xsl"/>
-       
-       <xsl:template name="first_page_frames">
-               <frame id="main" x1="1cm" y1="2.5cm" width="19.0cm" height="23cm"/>
-       </xsl:template>
-       
-       <xsl:template match="/">
-               <xsl:call-template name="rml"/>
-       </xsl:template>
-
-       <!-- stylesheet -->
-
-       <xsl:template name="stylesheet">
-               <blockTableStyle id="products">
-                        <blockFont name="Helvetica-Bold" size="10" start="0,0" stop="-1,0"/>
-                        <blockBackground colorName="grey" start="0,0" stop="-1,0"/>
-                        <blockTextColor colorName="white" start="0,0" stop="-1,0"/>
-                        <blockValign value="TOP"/>
-                        <blockAlignment value="CENTER" start="0,0" stop="-1,0"/>
-                        <blockAlignment value="RIGHT" start="1,1" stop="-1,-1"/>
-                        <lineStyle kind="GRID" colorName="black"/>
-               </blockTableStyle>
-       </xsl:template>
-       
-       <xsl:template name="story">
-               <xsl:apply-templates select="lotlist"/>
-       </xsl:template>
-       
-       <xsl:template name="lotlist">
-               <nextFrame/>
-               <setNextTemplate name="other_pages"/>
-               <xsl:apply-templates select="lot"/>
-       </xsl:template>
-       
-       <xsl:template match="lot">
-               
-               <spacer length="1cm"/>
-
-               <blockTable colWidths="2cm,6cm,2.5cm,2cm,2cm,2cm,2.5cm" style="products" repeatRows="1">
-                       <tr>
-                               <td t="1">Code</td><td t="1">Product</td><td t="1">Variants</td><td t="1">Amount</td><td t="1">UoM</td><td t="1">Unit Price</td><td t="1">Value</td>
-                       </tr>
-                       <xsl:apply-templates select="product"/>
-               </blockTable>
-               
-<!--
-               <setNextTemplate name="first_page"/>
-               <nextFrame/>
--->
-       </xsl:template>
-       
-       <xsl:template match="product">
-               <tr>
-                       <td><para><xsl:value-of select="code"/></para></td>
-                       <td><para><xsl:value-of select="name"/></para></td>
-                       <td><para><xsl:value-of select="variants"/></para></td>
-                       <td><xsl:value-of select="amount"/></td>
-                       <td><xsl:value-of select="uom"/></td>
-                       <td><xsl:value-of select="price"/></td>
-                       <td><xsl:value-of select="amount * price"/></td>
-<!--           <td><xsl:value-of select="//product_amount[id=$product_id]/amount"/></td>
-                       <td><xsl:value-of select="//product_amount[id=$product_id]/amount * price"/></td> -->
-               </tr>
-       </xsl:template>
-
-</xsl:stylesheet>
index d9e50d2..f6cf238 100644 (file)
           </para>
         </td>
         <td>
-          <para style="terp_default_9">[[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.title) or '' ]] [[ picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.name ]]</para>
-          <para style="terp_default_9">[[ (picking.address_id and picking.address_id.title) or '' ]] [[ (picking.address_id and picking.address_id.name) or '' ]] </para>
-          <para style="terp_default_9">[[ (picking.address_id and picking.address_id.street) or '' ]] </para>
-          <para style="terp_default_9">[[ (picking.address_id and picking.address_id.zip) or '' ]] [[ (picking.address_id and picking.address_id.city) or '' ]] [[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or '' ]] </para>
+          <para style="terp_default_9">[[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.title) or '' ]][[ picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.name ]]</para>
+          <para style="terp_default_9">[[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]][[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]]</para>
+          <para style="terp_default_9">[[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.street) or '' ]]</para>
+          <para style="terp_default_9">[[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.zip) or '' ]][[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.city) or '' ]][[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or '' ]]</para>
           <para style="terp_default_9">[[ (picking.address_id and picking.address_id.country_id and picking.address_id.country_id.name) or '' ]]</para>
         </td>
       </tr>
           <para style="terp_tblheader_General_Centre">Expected Shipping Date </para>
         </td>
         <td>
-          <para style="terp_tblheader_General_Centre"></para>
+          <para style="terp_tblheader_General_Centre">weight</para>
         </td>
       </tr>
     </blockTable>
           <para style="terp_default_Centre_8">[[ picking.origin ]]</para>
         </td>
         <td>
-          <para style="terp_default_Centre_8">[[ (picking.address_id and picking.address_id.title) or '' ]] [[ (picking.address_id and picking.address_id.name) or '' ]] </para>
+          <para style="terp_default_Centre_8">[[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]][[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]]</para>
         </td>
         <td>
-          <para style="terp_default_Centre_8">[[ formatLang(picking.min_date,date_time = True) ]]</para>
+          <para style="terp_default_Centre_8">[[  formatLang(picking.min_date,date_time = True) ]]</para>
         </td>
         <td>
-          <para style="terp_default_Centre_8"></para>
+          <para style="terp_default_Centre_8">[[ formatLang(picking.weight) ]]</para>
         </td>
       </tr>
     </blockTable>
         </td>
       </tr>
     </blockTable>
-    <para style="terp_default_2"/>
+    <para style="terp_default_2">
+      <font color="white"> </font>
+    </para>
     <section>
       <para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state == 'assigned' )],'move_lines') ]]</para>
       <blockTable colWidths="277.0,51.0,56.0,58.0,22.0,56.0" style="Move_Line_Contect_Assign_State">
             <para style="terp_default_9">[ [[ move_lines.product_id.default_code ]] ] [[ move_lines.product_id.name ]]</para>
           </td>
           <td>
-            <para style="terp_default_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para>
+            <para style="terp_default_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or  '' ]]</para>
           </td>
           <td>
             <para style="terp_default_Right_9">[[ move_lines.state ]]</para>
           </td>
           <td>
-            <para style="terp_default_Right_9">[[ move_lines.product_qty ]] </para>
+            <para style="terp_default_Right_9">[[ formatLang(move_lines.product_qty) ]]</para>
           </td>
           <td>
             <para style="terp_default_Right_9">[[ move_lines.product_uom.name ]]</para>
     <para style="terp_default_9">
       <font color="white"> </font>
     </para>
-    <para style="terp_default_Bold_9">Non Assigned Products: [[ (line.state == 'assigned') and removeParentNode('para') ]]</para>
+    <para style="terp_default_Bold_9">Non Assigned Products: [[ ((line.state == 'assigned') or (line.state == 'done')) and  removeParentNode('para') ]]</para>
     <para style="terp_default_Bold_9">
       <font color="white"> </font>
     </para>
     <section>
-      <para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]</para>
+      <para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state !=  'assigned' )],'move_lines') ]]</para>
       <blockTable colWidths="277.0,51.0,56.0,58.0,22.0,55.0" style="Move_Line_Content_Other_State">
         <tr>
           <td>
             <para style="terp_default_9">[ [[ move_lines.product_id.default_code ]] ] [[ move_lines.product_id.name ]]</para>
           </td>
           <td>
-            <para style="terp_default_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para>
+            <para style="terp_default_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or  '' ]]</para>
           </td>
           <td>
             <para style="terp_default_Right_9">[[ move_lines.state ]]</para>
           </td>
           <td>
-            <para style="terp_default_Right_9">[[ move_lines.product_qty ]] </para>
+            <para style="terp_default_Right_9">[[ formatLang(move_lines.product_qty) ]]</para>
           </td>
           <td>
             <para style="terp_default_Right_9">[[ move_lines.product_uom.name ]]</para>
index 352709e..b8acb06 100644 (file)
@@ -791,7 +791,7 @@ class stock_production_lot(osv.osv):
         ''')
         res.update(dict(cr.fetchall()))
         return res
-    
+
     def _stock_search(self, cr, uid, obj, name, args):
         locations = self.pool.get('stock.location').search(cr, uid, [('usage','=','internal')])
         cr.execute('''select
@@ -803,12 +803,12 @@ class stock_production_lot(osv.osv):
                 location_id in ('''+','.join(map(str, locations)) +''')
             group by
                 prodlot_id
-            having  sum(name)  ''' + str(args[0][1]) + ''' ''' + str(args[0][2]) 
+            having  sum(name)  ''' + str(args[0][1]) + ''' ''' + str(args[0][2])
         )
         res = cr.fetchall()
         ids = [('id','in',map(lambda x:x[0], res))]
         return ids
-    
+
     _columns = {
         'name': fields.char('Serial', size=64, required=True),
         'ref': fields.char('Internal Ref', size=64),
index c5ddcf0..ed71ca9 100644 (file)
@@ -9,11 +9,11 @@
         <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="Print Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/>
 
-        <report id="report_location_overview" model="stock.location" name="stock.location.overview" string="Location Overview" xml="stock/report/lot_overview.xml" xsl="stock/report/lot_overview.xsl"/>
+        <report auto="False"  id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Overview" rml="stock/report/lot_overview.rml"/>
 
         <report auto="False" id="report_lot_location" model="stock.location" name="lot.location" rml="stock/report/lot_location.rml" string="Lots by location"/>
 
-        <report id="report_location_overview_all" model="stock.location" name="stock.location.overview.all" string="Location Content (With children)" xml="stock/report/lot_overview_all.xml" xsl="stock/report/lot_overview_all.xsl"/>
+        <report id="report_location_overview_all" model="stock.location" name="lot.stock.overview_all" string="Location Content (With children)" rml="stock/report/lot_overview_all.rml"/>
 
     </data>
 </openerp>