From 0a6693e99d2bade254430c8aa6d95cb453d24609 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Tue, 18 May 2010 19:03:50 +0530 Subject: [PATCH] stock: Add the difference between date date_planned and date_expected in report bzr revid: sbh@tinyerp.com-20100518133350-4mamc77r6kdewh84 --- addons/stock/report/report_stock_move.py | 5 +++-- addons/stock/report/report_stock_move_view.xml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py index 11d855e63d9..69ceea1737c 100755 --- a/addons/stock/report/report_stock_move.py +++ b/addons/stock/report/report_stock_move.py @@ -44,7 +44,7 @@ class report_stock_move(osv.osv): 'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True, help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\ \nThe state is \'Waiting\' if the move is waiting for another one.'), - + 'day_diff':fields.integer('Days difference',readonly=True), } def init(self, cr): @@ -56,6 +56,7 @@ class report_stock_move(osv.osv): to_char(date_trunc('day',m.date_planned), 'YYYY') as year, to_char(date_trunc('day',m.date_planned), 'MM') as month, to_char(date_trunc('day',m.date_planned), 'YYYY-MM-DD') as day, + (date(m.date_planned)-date(m.date_expected)) as day_diff, m.address_id as partner_id, m.location_id as location_id, m.location_dest_id as location_dest_id, @@ -69,6 +70,6 @@ class report_stock_move(osv.osv): m.product_id=pp.id and pp.product_tmpl_id=pt.id group by m.id, m.product_id,m.address_id, m.location_id, m.location_dest_id, - m.date_planned, m.state, m.product_uom,pt.standard_price ) + m.date_planned, m.state, m.product_uom,pt.standard_price,m.date_expected ) """) report_stock_move() diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml index 8a72f5182d8..3a7b233504a 100755 --- a/addons/stock/report/report_stock_move_view.xml +++ b/addons/stock/report/report_stock_move_view.xml @@ -8,6 +8,7 @@ +