From: Numerigraphe - Lionel Sausin Date: Tue, 13 Sep 2011 12:47:05 +0000 (+0200) Subject: [IMP] Stock: make the latest inventory date report usefull by displaying the product... X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=b18c7dd3e7ecd58d1fb686b38c540674034b44b6;p=odoo%2Fodoo.git [IMP] Stock: make the latest inventory date report usefull by displaying the product name and the latest date of inventory lp bug: https://launchpad.net/bugs/817937 fixed bzr revid: ls@numerigraphe.fr-20110913124705-ajyooi4xoz9il54b --- diff --git a/addons/stock/report_stock_view.xml b/addons/stock/report_stock_view.xml index 61381af..b097b5b 100644 --- a/addons/stock/report_stock_view.xml +++ b/addons/stock/report_stock_view.xml @@ -74,7 +74,6 @@ - @@ -87,7 +86,6 @@
- diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 0aa8d95..47d9432 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -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()