[IMP] Stock: make the latest inventory date report usefull by displaying the product...
authorNumerigraphe - Lionel Sausin <ls@numerigraphe.fr>
Tue, 13 Sep 2011 12:47:05 +0000 (14:47 +0200)
committerNumerigraphe - Lionel Sausin <ls@numerigraphe.fr>
Tue, 13 Sep 2011 12:47:05 +0000 (14:47 +0200)
lp bug: https://launchpad.net/bugs/817937 fixed

bzr revid: ls@numerigraphe.fr-20110913124705-ajyooi4xoz9il54b

addons/stock/report_stock_view.xml
addons/stock/stock.py

index 61381af..b097b5b 100644 (file)
@@ -74,7 +74,6 @@
                        <field name="arch" type="xml">
                                <tree string="Dates of Inventories">
                                        <field name="product_id"/>
-                                       <field name="id"/>
                                        <field name="create_date" />
                                </tree>
                        </field>
@@ -87,7 +86,6 @@
                        <field name="arch" type="xml">
                                <form string="Dates of Inventories">
                                        <field name="product_id" select="1"/>
-                                       <field name="id" select="2"/>
                                        <field name="create_date" select="1" />
                                </form>
                        </field>
index 0aa8d95..47d9432 100644 (file)
@@ -1628,8 +1628,7 @@ class report_stock_lines_date(osv.osv):
     _description = "Dates of Inventories"
     _auto = False
     _columns = {
-        'id': fields.integer('Inventory Line Id', readonly=True),
-        'product_id': fields.integer('Product Id', readonly=True),
+        'product_id': fields.many2one('product.product', 'Product Id', readonly=True),
         'create_date': fields.datetime('Latest Date of Inventory'),
         }
 
@@ -1637,7 +1636,7 @@ class report_stock_lines_date(osv.osv):
         cr.execute("""
             create or replace view report_stock_lines_date as (
                 select
-                l.id as id,
+                p.id as id,
                 p.id as product_id,
                 max(l.create_date) as create_date
                 from
@@ -1645,7 +1644,7 @@ class report_stock_lines_date(osv.osv):
                 left outer join
                 stock_inventory_line l on (p.id=l.product_id)
                 where l.create_date is not null
-                group by p.id,l.id
+                group by p.id
             )""")
 
 report_stock_lines_date()