[IMP] report_crm: Add the partner_id and section_id in all view

bzr revid: sbh@tinyerp.com-20100305081949-pd9032ukqas9oa1h
This commit is contained in:
sbh (Open ERP) 2010-03-05 13:49:49 +05:30
parent 990552c684
commit c872a4a446
9 changed files with 26 additions and 14 deletions

View File

@ -8,7 +8,8 @@ class report_crm_claim(osv.osv):
_columns = {
'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')]"),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"),
'partner_id': fields.many2one('res.partner', 'Partner'),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_claim')
@ -22,6 +23,7 @@ class report_crm_claim(osv.osv):
c.user_id,
c.stage_id,
c.section_id,
c.partner_id,
c.categ_id,
count(*) as nbr,
0 as avg_answers,
@ -30,7 +32,7 @@ class report_crm_claim(osv.osv):
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_claim c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.stage_id,c.categ_id
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.stage_id,c.categ_id,c.partner_id
)""")
report_crm_claim()

View File

@ -10,12 +10,13 @@
<tree string="Claims">
<field name="name" />
<field name="month"/>
<field name="section_id" />
<field name="user_id" />
<field name="partner_id" />
<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="categ_id" invisible="1"/>
</tree>
</field>

View File

@ -11,6 +11,7 @@ class report_crm_fundraising(osv.osv):
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner'),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_fundraising')
@ -24,6 +25,7 @@ class report_crm_fundraising(osv.osv):
c.user_id,
c.section_id,
c.categ_id,
c.partner_id,
count(*) as nbr,
0 as avg_answers,
0.0 as perc_done,
@ -34,7 +36,7 @@ class report_crm_fundraising(osv.osv):
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_fundraising c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id,c.partner_id
)""")
report_crm_fundraising()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -13,14 +13,15 @@
<tree string="Fundraising">
<field name="name" />
<field name="month"/>
<field name="section_id" />
<field name="user_id" />
<field name="partner_id" />
<field name="nbr" string="#Fundraising"/>
<field name="amount_revenue"/>
<field name="probability"/>
<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="categ_id" invisible="1"/>
</tree>
</field>

View File

@ -9,6 +9,7 @@ class report_crm_lead(osv.osv):
'delay_close': fields.char('Delay to close', size=20, readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]", readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner'),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_lead')
@ -23,6 +24,7 @@ class report_crm_lead(osv.osv):
c.stage_id,
c.section_id,
c.categ_id,
c.partner_id,
count(*) as nbr,
0 as avg_answers,
0.0 as perc_done,
@ -30,7 +32,7 @@ class report_crm_lead(osv.osv):
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_lead c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,categ_id
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.stage_id,categ_id,c.partner_id
)""")
report_crm_lead()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -13,11 +13,12 @@
<tree string="Leads">
<field name="name" />
<field name="month"/>
<field name="section_id" />
<field name="user_id" />
<field name="partner_id" />
<field name="nbr" string="#Leads"/>
<field name="delay_close"/>
<field name="section_id" invisible="1"/>
<field name="state" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="stage_id" invisible="1"/>
<field name="categ_id" invisible="1"/>
</tree>

View File

@ -15,12 +15,12 @@
<field name="month"/>
<field name="section_id" />
<field name="user_id" />
<field name="partner_id"/>
<field name="nbr" string="#Opportunities"/>
<field name="amount_revenue"/>
<field name="probability" widget="progressbar"/>
<field name="amount_revenue_prob"/>
<field name="delay_close"/>
<field name="partner_id" invisible="1"/>
<field name="state" invisible="1"/>
<field name="stage_id" invisible="1"/>
<field name="categ_id" invisible="1"/>

View File

@ -9,6 +9,7 @@ class report_crm_phonecall(osv.osv):
_columns = {
'delay_close': fields.char('Delay to close', size=20, readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]"),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_phonecall')
@ -22,6 +23,7 @@ class report_crm_phonecall(osv.osv):
c.user_id,
c.section_id,
c.categ_id,
c.partner_id,
count(*) as nbr,
0 as avg_answers,
0.0 as perc_done,
@ -29,7 +31,7 @@ class report_crm_phonecall(osv.osv):
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_phonecall c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.categ_id
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id, c.categ_id,c.partner_id
)""")
report_crm_phonecall()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -13,11 +13,12 @@
<tree string="Phone calls">
<field name="name" />
<field name="month"/>
<field name="section_id" />
<field name="user_id" />
<field name="partner_id" />
<field name="nbr" string="#Phone calls" />
<field name="delay_close"/>
<field name="state" invisible="1"/>
<field name="section_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="categ_id" invisible="1"/>
</tree>
</field>