From d24eb97eb459b52da05c70395511015a0a3e1656 Mon Sep 17 00:00:00 2001 From: Sofia Date: Tue, 16 Dec 2008 12:37:46 +0530 Subject: [PATCH] * In reports, graphs on opportunities shows estimated revenues instead of number of cases bzr revid: sahibsofia@gmail.com-20081216070746-aduwdhfkkgfunp7p --- addons/crm_configuration/crm_report_view.xml | 9 ++++++--- addons/crm_configuration/report/crm_report.py | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/addons/crm_configuration/crm_report_view.xml b/addons/crm_configuration/crm_report_view.xml index fc4a95e1610..567bfcbfd4d 100644 --- a/addons/crm_configuration/crm_report_view.xml +++ b/addons/crm_configuration/crm_report_view.xml @@ -16,10 +16,10 @@ + - @@ -34,6 +34,7 @@ + @@ -47,7 +48,7 @@ - + @@ -82,6 +83,7 @@ + @@ -98,6 +100,7 @@ + @@ -111,7 +114,7 @@ - + diff --git a/addons/crm_configuration/report/crm_report.py b/addons/crm_configuration/report/crm_report.py index 7cd7f19b18d..775eb7ec5cc 100644 --- a/addons/crm_configuration/report/crm_report.py +++ b/addons/crm_configuration/report/crm_report.py @@ -38,6 +38,7 @@ class report_crm_case_section_categ2(osv.osv): 'section_id':fields.many2one('crm.case.section', 'Section', readonly=True), 'category2_id':fields.many2one('crm.case.category2', 'Type', readonly=True), 'stage_id':fields.many2one('crm.case.stage', 'Stage', readonly=True), + 'amount_revenue': fields.float('Est.Revenue', readonly=True), 'nbr': fields.integer('# of Cases', readonly=True), 'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True), 'delay_close': fields.char('Delay Close', size=20, readonly=True), @@ -56,6 +57,7 @@ class report_crm_case_section_categ2(osv.osv): c.stage_id, c.section_id, count(*) as nbr, + sum(planned_revenue) as amount_revenue, to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_case c @@ -74,6 +76,7 @@ class report_crm_case_section_stage(osv.osv): 'section_id':fields.many2one('crm.case.section', 'Section', readonly=True), 'categ_id':fields.many2one('crm.case.categ', 'Category', readonly=True), 'stage_id':fields.many2one('crm.case.stage', 'Stage', readonly=True), + 'amount_revenue': fields.float('Est.Revenue', readonly=True), 'nbr': fields.integer('# of Cases', readonly=True), 'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True), 'delay_close': fields.char('Delay Close', size=20, readonly=True), @@ -91,6 +94,7 @@ class report_crm_case_section_stage(osv.osv): c.stage_id, c.section_id, count(*) as nbr, + sum(planned_revenue) as amount_revenue, to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close from crm_case c