[IMP]report_crm: Fix the view of report
authorsbh (Open ERP) <sbh@tinyerp.com>
Wed, 3 Mar 2010 11:35:55 +0000 (17:05 +0530)
committersbh (Open ERP) <sbh@tinyerp.com>
Wed, 3 Mar 2010 11:35:55 +0000 (17:05 +0530)
bzr revid: sbh@tinyerp.com-20100303113555-hibktw5szm3unzhn

addons/report_crm/report_crm_claim.py
addons/report_crm/report_crm_claim_view.xml
addons/report_crm/report_crm_fundraising.py
addons/report_crm/report_crm_fundraising_view.xml
addons/report_crm/report_crm_lead_view.xml
addons/report_crm/report_crm_view.xml

index c329997..e78f2c8 100644 (file)
@@ -6,10 +6,6 @@ class report_crm_claim(osv.osv):
     _auto = False
     _inherit = "report.crm.case"
     _columns = {
-        'probability': fields.float('Avg. Probability', readonly=True),
-        'amount_revenue': fields.float('Est.Revenue', readonly=True),
-        'amount_costs': fields.float('Est.Cost', readonly=True),
-        'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
         'delay_close': fields.char('Delay to close', size=20, readonly=True),
         'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]", readonly=True),
         'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"),        
@@ -24,14 +20,13 @@ class report_crm_claim(osv.osv):
                     to_char(c.create_date, 'MM') as month,
                     c.state,
                     c.user_id,
-                    c.section_id,
                     c.stage_id,
+                    c.section_id,
                     c.categ_id,
                     count(*) as nbr,
-                    sum(planned_revenue) as amount_revenue,
-                    sum(planned_cost) as amount_costs,
-                    sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
-                    avg(probability)::decimal(16,2) as probability,
+                    0 as avg_answers,
+                    0.0 as perc_done,
+                    0.0 as perc_cancel,
                     to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
                 from
                     crm_claim c
index 6793355..22d4a2b 100644 (file)
@@ -8,16 +8,16 @@
             <field name="type">tree</field>
             <field name="arch" type="xml">
                <tree string="Claims">
-                       <field name="name" />
+                                       <field name="name" />
                                        <field name="month"/>
-                       <field name="nbr" string="#Claim"/>
-                    <field name="amount_revenue"/>
-                    <field name="probability"/>
-                    <field name="amount_revenue_prob"/>
-                    <field name="delay_close"/>
-                    <field name="section_id" invisible="1"/>
-                    <field name="stage_id"  invisible="1"/>
-                    <field name="categ_id" invisible="1"/>
+                                       <field name="nbr" string="#Claim"/>
+                       <field name="delay_close"/>
+                       <field name="state"  invisible="1"/>
+                       <field name="section_id" invisible="1"/>
+                       <field name="stage_id" invisible="1"/>
+                       <field name="user_id" invisible="1"/>
+                                       <field name="stage_id"  invisible="1"/>
+                       <field name="categ_id" invisible="1"/>
                 </tree>
             </field>
         </record>
index 518e03c..ef01c52 100644 (file)
@@ -31,8 +31,7 @@ class report_crm_fundraising(osv.osv):
                     0 as avg_answers,
                     0.0 as perc_done,
                     0.0 as perc_cancel,
-                    sum(planned_revenue) as amount_revenue,
-                    sum(planned_cost) as amount_costs,
+                    sum(planned_revenue) as amount_revenue,                    
                     sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
                     avg(probability)::decimal(16,2) as probability,
                     to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
index da92023..633023d 100644 (file)
@@ -19,6 +19,7 @@
                     <field name="amount_revenue_prob"/>
                     <field name="delay_close"/>
                     <field name="state" invisible="1"/>
+                    <field name="section_id" invisible="1"/>
                     <field name="user_id" invisible="1"/>
                     <field name="stage_id"  invisible="1"/>
                     <field name="categ_id" invisible="1"/>
index 97903e7..3b87dfe 100644 (file)
@@ -16,6 +16,7 @@
                                <field name="nbr" string="#Leads"/>
                 <field name="delay_close"/>
                 <field name="section_id" invisible="1"/>
+                <field name="state"  invisible="1"/>
                 <field name="stage_id" invisible="1"/>
                 <field name="user_id" invisible="1"/>
                                <field name="stage_id"  invisible="1"/>
index c55cf54..61fe776 100644 (file)
@@ -56,7 +56,7 @@
                                <filter string="This Year" icon="terp-hr" domain="[('name','=',time.localtime()[0])]"/>
                                                <filter string="This Month" icon="terp-hr" domain="[('month','=',time.strftime('%%m'))]"/>
                         <separator orientation="vertical"/>    
-                                               <filter string="Current" icon="terp-hr" domain="[('state','=','draft')]"/>
+                                               <filter string="Current" icon="terp-hr" domain="[('state','in',('open','draft'))]"/>
                                                <filter string="Won" icon="terp-hr" domain="[('state','=','done')]"/>
                                                <filter string="Lost" icon="terp-hr" domain="[('state','=','cancel')]"/>
                                                <separator orientation="vertical"/>