[IMP] report_crm:Add the group by modfiy the view of crm_opportunity
bzr revid: sbh@tinyerp.com-20100303050509-k85yjklolz83gsv2
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
<field name="month"/>
|
||||
<field name="nbr" />
|
||||
<field name="delay_close"/>
|
||||
<field name="stage_id" invisible="1"/>
|
||||
</tree>
|
||||
<field name="stage_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_crm_lead_user_form" model="ir.ui.view">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from osv import fields,osv
|
||||
import tools
|
||||
|
||||
class report_crm_opportunity_user(osv.osv):
|
||||
_name = "report.crm.opportunity.user"
|
||||
class report_crm_opportunity(osv.osv):
|
||||
_name = "report.crm.opportunity"
|
||||
_description = "Opportunity by user and section"
|
||||
_auto = False
|
||||
_inherit = "report.crm.case.user"
|
||||
@@ -11,53 +11,22 @@ class report_crm_opportunity_user(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),
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'report_crm_opportunity_user')
|
||||
cr.execute("""
|
||||
create or replace view report_crm_opportunity_user as (
|
||||
select
|
||||
min(c.id) as id,
|
||||
to_char(c.create_date, 'YYYY') as name,
|
||||
to_char(c.create_date, 'MM') as month,
|
||||
c.state,
|
||||
c.user_id,
|
||||
c.section_id,
|
||||
count(*) as nbr,
|
||||
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
|
||||
from
|
||||
crm_opportunity c
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id
|
||||
)""")
|
||||
report_crm_opportunity_user()
|
||||
|
||||
class report_crm_opportunity_categ(osv.osv):
|
||||
_name = "report.crm.opportunity.categ"
|
||||
_description = "Opportunity by section and category"
|
||||
_auto = False
|
||||
_inherit = "report.crm.case.categ"
|
||||
_columns = {
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"),
|
||||
'amount_revenue': fields.float('Est.Revenue', readonly=True),
|
||||
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
|
||||
'probability': fields.float('Avg. Probability', readonly=True),
|
||||
'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
'stage_id':fields.many2one('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'report_crm_opportunity_categ')
|
||||
tools.drop_view_if_exists(cr, 'report_crm_opportunity')
|
||||
cr.execute("""
|
||||
create or replace view report_crm_opportunity_categ as (
|
||||
create or replace view report_crm_opportunity as (
|
||||
select
|
||||
min(c.id) as id,
|
||||
to_char(c.create_date, 'YYYY') as name,
|
||||
to_char(c.create_date, 'MM') as month,
|
||||
c.categ_id,
|
||||
c.state,
|
||||
c.user_id,
|
||||
c.section_id,
|
||||
c.categ_id,
|
||||
c.stage_id,
|
||||
count(*) as nbr,
|
||||
sum(planned_revenue) as amount_revenue,
|
||||
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
|
||||
@@ -65,168 +34,203 @@ class report_crm_opportunity_categ(osv.osv):
|
||||
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
|
||||
from
|
||||
crm_opportunity c
|
||||
group by c.categ_id,to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.section_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
|
||||
)""")
|
||||
report_crm_opportunity_categ()
|
||||
report_crm_opportunity()
|
||||
|
||||
class report_crm_opportunity_section(osv.osv):
|
||||
_name = "report.crm.opportunity.section"
|
||||
_description = "Opportunity by Section"
|
||||
_auto = False
|
||||
_inherit = "report.crm.case.section"
|
||||
|
||||
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
|
||||
res = {}
|
||||
state_perc = 0.0
|
||||
avg_ans = 0.0
|
||||
|
||||
for case in self.browse(cr, uid, ids, context):
|
||||
if field_name != 'avg_answers':
|
||||
state = field_name[5:]
|
||||
cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state))
|
||||
state_cases = cr.fetchone()[0]
|
||||
perc_state = (state_cases / float(case.nbr_cases) ) * 100
|
||||
|
||||
res[case.id] = perc_state
|
||||
else:
|
||||
cr.execute('select count(*) from crm_case_log l where l.section_id=%s'%(case.section_id.id))
|
||||
logs = cr.fetchone()[0]
|
||||
|
||||
avg_ans = logs / case.nbr_cases
|
||||
res[case.id] = avg_ans
|
||||
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'avg_answers': fields.function(_get_data,string='Avg. Answers', method=True,type="integer"),
|
||||
'perc_done': fields.function(_get_data,string='%Done', method=True,type="float"),
|
||||
'perc_cancel': fields.function(_get_data,string='%Cancel', method=True,type="float"),
|
||||
'delay_close': fields.char('Delay to close', size=20, readonly=True),
|
||||
}
|
||||
_order = 'name desc, section_id'
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'report_crm_opportunity_section')
|
||||
cr.execute("""
|
||||
create or replace view report_crm_opportunity_section as (
|
||||
select
|
||||
min(c.id) as id,
|
||||
to_char(c.create_date, 'YYYY') as name,
|
||||
to_char(c.create_date, 'MM') as month,
|
||||
count(*) as nbr_cases,
|
||||
c.section_id as section_id,
|
||||
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_opportunity c
|
||||
group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'),c.section_id
|
||||
)""")
|
||||
report_crm_opportunity_section()
|
||||
|
||||
class report_crm_opportunity_section_type(osv.osv):
|
||||
_name = "report.crm.opportunity.section.type"
|
||||
_inherit = "report.crm.case.section.type"
|
||||
_description = "Opportunity by section and type"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Opportunity Type', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
'amount_revenue': fields.float('Est.Revenue', readonly=True),
|
||||
'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
}
|
||||
_order = 'type_id'
|
||||
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, "report_crm_opportunity_section_type")
|
||||
cr.execute("""
|
||||
create view report_crm_opportunity_section_type as (
|
||||
select
|
||||
min(c.id) as id,
|
||||
to_char(c.create_date,'YYYY') as name,
|
||||
to_char(c.create_date, 'MM') as month,
|
||||
c.user_id,
|
||||
c.state,
|
||||
c.type_id,
|
||||
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_opportunity c
|
||||
where c.type_id is not null
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.user_id, c.state, c.stage_id, c.type_id, c.section_id)""")
|
||||
|
||||
report_crm_opportunity_section_type()
|
||||
|
||||
class report_crm_opportunity_section_categ_stage(osv.osv):
|
||||
_name = "report.crm.opportunity.section.categ.stage"
|
||||
_inherit = "report.crm.case.section.categ.stage"
|
||||
_description = "Opportunity by Section, Category and Stage"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'categ_id': fields.many2one('crm.case.categ','Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
'stage_id':fields.many2one('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
}
|
||||
_order = 'stage_id, categ_id'
|
||||
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, "report_crm_opportunity_section_categ_stage")
|
||||
cr.execute("""
|
||||
create view report_crm_opportunity_section_categ_stage as (
|
||||
select
|
||||
min(c.id) as id,
|
||||
to_char(c.create_date,'YYYY') as name,
|
||||
to_char(c.create_date, 'MM') as month,
|
||||
c.user_id,
|
||||
c.categ_id,
|
||||
c.state,
|
||||
c.stage_id,
|
||||
c.section_id,
|
||||
count(*) as nbr,
|
||||
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
|
||||
from
|
||||
crm_opportunity c
|
||||
where c.categ_id is not null AND c.stage_id is not null
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),c.user_id, c.categ_id, c.state, c.stage_id, c.section_id)""")
|
||||
|
||||
report_crm_opportunity_section_categ_stage()
|
||||
|
||||
class report_crm_opportunity_section_categ_type(osv.osv):
|
||||
_name = "report.crm.opportunity.section.categ.type"
|
||||
_inherit = "report.crm.case.section.categ.type"
|
||||
_description = "Opportunity by Section, Category and Type"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'categ_id':fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Opportunity Type', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
'stage_id':fields.many2one('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
}
|
||||
_order = 'categ_id, type_id'
|
||||
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, "report_crm_opportunity_section_categ_type")
|
||||
cr.execute("""
|
||||
create view report_crm_opportunity_section_categ_type as (
|
||||
select
|
||||
min(c.id) as id,
|
||||
to_char(c.create_date, 'YYYY') as name,
|
||||
to_char(c.create_date, 'MM') as month,
|
||||
c.user_id,
|
||||
c.categ_id,
|
||||
c.type_id,
|
||||
c.state,
|
||||
c.stage_id,
|
||||
c.section_id,
|
||||
count(*) as nbr,
|
||||
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
|
||||
from
|
||||
crm_opportunity c
|
||||
where c.categ_id is not null AND c.type_id is not null
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),c.user_id, c.categ_id, c.type_id, c.state, c.stage_id, c.section_id)""")
|
||||
|
||||
report_crm_opportunity_section_categ_type()
|
||||
#class report_crm_opportunity_categ(osv.osv):
|
||||
# _name = "report.crm.opportunity.categ"
|
||||
# _description = "Opportunity by section and category"
|
||||
# _auto = False
|
||||
# _inherit = "report.crm.case.categ"
|
||||
# _columns = {
|
||||
# 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"),
|
||||
# 'amount_revenue': fields.float('Est.Revenue', readonly=True),
|
||||
# 'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
|
||||
# 'probability': fields.float('Avg. Probability', readonly=True),
|
||||
# 'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
# }
|
||||
#
|
||||
# def init(self, cr):
|
||||
# tools.drop_view_if_exists(cr, 'report_crm_opportunity_categ')
|
||||
# cr.execute("""
|
||||
# create or replace view report_crm_opportunity_categ as (
|
||||
# select
|
||||
# min(c.id) as id,
|
||||
# to_char(c.create_date, 'YYYY') as name,
|
||||
# to_char(c.create_date, 'MM') as month,
|
||||
# c.categ_id,
|
||||
# c.state,
|
||||
# c.section_id,
|
||||
# count(*) as nbr,
|
||||
# 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
|
||||
# from
|
||||
# crm_opportunity c
|
||||
# group by c.categ_id,to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.section_id
|
||||
# )""")
|
||||
#report_crm_opportunity_categ()
|
||||
#
|
||||
#class report_crm_opportunity_section(osv.osv):
|
||||
# _name = "report.crm.opportunity.section"
|
||||
# _description = "Opportunity by Section"
|
||||
# _auto = False
|
||||
# _inherit = "report.crm.case.section"
|
||||
#
|
||||
# def _get_data(self, cr, uid, ids, field_name, arg, context={}):
|
||||
# res = {}
|
||||
# state_perc = 0.0
|
||||
# avg_ans = 0.0
|
||||
#
|
||||
# for case in self.browse(cr, uid, ids, context):
|
||||
# if field_name != 'avg_answers':
|
||||
# state = field_name[5:]
|
||||
# cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state))
|
||||
# state_cases = cr.fetchone()[0]
|
||||
# perc_state = (state_cases / float(case.nbr_cases) ) * 100
|
||||
#
|
||||
# res[case.id] = perc_state
|
||||
# else:
|
||||
# cr.execute('select count(*) from crm_case_log l where l.section_id=%s'%(case.section_id.id))
|
||||
# logs = cr.fetchone()[0]
|
||||
#
|
||||
# avg_ans = logs / case.nbr_cases
|
||||
# res[case.id] = avg_ans
|
||||
#
|
||||
# return res
|
||||
#
|
||||
# _columns = {
|
||||
# 'avg_answers': fields.function(_get_data,string='Avg. Answers', method=True,type="integer"),
|
||||
# 'perc_done': fields.function(_get_data,string='%Done', method=True,type="float"),
|
||||
# 'perc_cancel': fields.function(_get_data,string='%Cancel', method=True,type="float"),
|
||||
# 'delay_close': fields.char('Delay to close', size=20, readonly=True),
|
||||
# }
|
||||
# _order = 'name desc, section_id'
|
||||
# def init(self, cr):
|
||||
# tools.drop_view_if_exists(cr, 'report_crm_opportunity_section')
|
||||
# cr.execute("""
|
||||
# create or replace view report_crm_opportunity_section as (
|
||||
# select
|
||||
# min(c.id) as id,
|
||||
# to_char(c.create_date, 'YYYY') as name,
|
||||
# to_char(c.create_date, 'MM') as month,
|
||||
# count(*) as nbr_cases,
|
||||
# c.section_id as section_id,
|
||||
# 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_opportunity c
|
||||
# group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'),c.section_id
|
||||
# )""")
|
||||
#report_crm_opportunity_section()
|
||||
#
|
||||
#class report_crm_opportunity_section_type(osv.osv):
|
||||
# _name = "report.crm.opportunity.section.type"
|
||||
# _inherit = "report.crm.case.section.type"
|
||||
# _description = "Opportunity by section and type"
|
||||
# _auto = False
|
||||
# _columns = {
|
||||
# 'type_id': fields.many2one('crm.case.resource.type', 'Opportunity Type', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
# 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
# 'amount_revenue': fields.float('Est.Revenue', readonly=True),
|
||||
# 'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
# }
|
||||
# _order = 'type_id'
|
||||
#
|
||||
# def init(self, cr):
|
||||
# tools.sql.drop_view_if_exists(cr, "report_crm_opportunity_section_type")
|
||||
# cr.execute("""
|
||||
# create view report_crm_opportunity_section_type as (
|
||||
# select
|
||||
# min(c.id) as id,
|
||||
# to_char(c.create_date,'YYYY') as name,
|
||||
# to_char(c.create_date, 'MM') as month,
|
||||
# c.user_id,
|
||||
# c.state,
|
||||
# c.type_id,
|
||||
# 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_opportunity c
|
||||
# where c.type_id is not null
|
||||
# group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.user_id, c.state, c.stage_id, c.type_id, c.section_id)""")
|
||||
#
|
||||
#report_crm_opportunity_section_type()
|
||||
#
|
||||
#class report_crm_opportunity_section_categ_stage(osv.osv):
|
||||
# _name = "report.crm.opportunity.section.categ.stage"
|
||||
# _inherit = "report.crm.case.section.categ.stage"
|
||||
# _description = "Opportunity by Section, Category and Stage"
|
||||
# _auto = False
|
||||
# _columns = {
|
||||
# 'categ_id': fields.many2one('crm.case.categ','Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
# 'stage_id':fields.many2one('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
# 'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
# }
|
||||
# _order = 'stage_id, categ_id'
|
||||
#
|
||||
# def init(self, cr):
|
||||
# tools.sql.drop_view_if_exists(cr, "report_crm_opportunity_section_categ_stage")
|
||||
# cr.execute("""
|
||||
# create view report_crm_opportunity_section_categ_stage as (
|
||||
# select
|
||||
# min(c.id) as id,
|
||||
# to_char(c.create_date,'YYYY') as name,
|
||||
# to_char(c.create_date, 'MM') as month,
|
||||
# c.user_id,
|
||||
# c.categ_id,
|
||||
# c.state,
|
||||
# c.stage_id,
|
||||
# c.section_id,
|
||||
# count(*) as nbr,
|
||||
# to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
|
||||
# from
|
||||
# crm_opportunity c
|
||||
# where c.categ_id is not null AND c.stage_id is not null
|
||||
# group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),c.user_id, c.categ_id, c.state, c.stage_id, c.section_id)""")
|
||||
#
|
||||
#report_crm_opportunity_section_categ_stage()
|
||||
#
|
||||
#class report_crm_opportunity_section_categ_type(osv.osv):
|
||||
# _name = "report.crm.opportunity.section.categ.type"
|
||||
# _inherit = "report.crm.case.section.categ.type"
|
||||
# _description = "Opportunity by Section, Category and Type"
|
||||
# _auto = False
|
||||
# _columns = {
|
||||
# 'categ_id':fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
# 'type_id': fields.many2one('crm.case.resource.type', 'Opportunity Type', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
# 'stage_id':fields.many2one('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]", readonly=True),
|
||||
# 'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
# }
|
||||
# _order = 'categ_id, type_id'
|
||||
#
|
||||
# def init(self, cr):
|
||||
# tools.sql.drop_view_if_exists(cr, "report_crm_opportunity_section_categ_type")
|
||||
# cr.execute("""
|
||||
# create view report_crm_opportunity_section_categ_type as (
|
||||
# select
|
||||
# min(c.id) as id,
|
||||
# to_char(c.create_date, 'YYYY') as name,
|
||||
# to_char(c.create_date, 'MM') as month,
|
||||
# c.user_id,
|
||||
# c.categ_id,
|
||||
# c.type_id,
|
||||
# c.state,
|
||||
# c.stage_id,
|
||||
# c.section_id,
|
||||
# count(*) as nbr,
|
||||
# to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
|
||||
# from
|
||||
# crm_opportunity c
|
||||
# where c.categ_id is not null AND c.type_id is not null
|
||||
# group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),c.user_id, c.categ_id, c.type_id, c.state, c.stage_id, c.section_id)""")
|
||||
#
|
||||
#report_crm_opportunity_section_categ_type()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -5,24 +5,29 @@
|
||||
Opportunities by user and section
|
||||
-->
|
||||
|
||||
<record id="view_crm_opportunity_user_tree" model="ir.ui.view">
|
||||
<field name="name">report.crm.opportunity.user.tree</field>
|
||||
<field name="model">report.crm.opportunity.user</field>
|
||||
<field name="inherit_id" ref="view_crm_case_user_tree"/>
|
||||
<record id="view_crm_opportunity_tree" model="ir.ui.view">
|
||||
<field name="name">report.crm.opportunity.tree</field>
|
||||
<field name="model">report.crm.opportunity</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="nbr" position="after">
|
||||
<tree string="Opportunities">
|
||||
<field name="name" />
|
||||
<field name="month"/>
|
||||
<field name="nbr" string="#Opportunities"/>
|
||||
<field name="delay_close"/>
|
||||
<field name="amount_revenue"/>
|
||||
<field name="amount_costs"/>
|
||||
<field name="amount_revenue_prob"/>
|
||||
<field name="probability"/>
|
||||
</field>
|
||||
</field>
|
||||
<field name="state"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="stage_id" invisible="1"/>
|
||||
<field name="categ_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_crm_opportunity_user_form" model="ir.ui.view">
|
||||
<field name="name">report.crm.opportunity.user.form</field>
|
||||
<field name="model">report.crm.opportunity.user</field>
|
||||
<field name="name">report.crm.opportunity.form</field>
|
||||
<field name="model">report.crm.opportunity</field>
|
||||
<field name="inherit_id" ref="view_crm_case_user_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
@@ -37,8 +42,8 @@
|
||||
</record>
|
||||
|
||||
<record id="view_crm_opportunity_user_graph" model="ir.ui.view">
|
||||
<field name="name">report.crm.opportunity.user.graph</field>
|
||||
<field name="model">report.crm.opportunity.user</field>
|
||||
<field name="name">report.crm.opportunity.graph</field>
|
||||
<field name="model">report.crm.opportunity</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph orientation="horizontal" string="Opportunity by User and Section" type="bar">
|
||||
@@ -51,7 +56,7 @@
|
||||
|
||||
<record id="view_crm_opportunity_user_filter" model="ir.ui.view">
|
||||
<field name="name">report.crm.opportunity.user.select</field>
|
||||
<field name="model">report.crm.opportunity.user</field>
|
||||
<field name="model">report.crm.opportunity</field>
|
||||
<field name="inherit_id" ref="view_crm_case_user_filter"/>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
@@ -60,18 +65,25 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_crm_opportunity_user_tree" model="ir.actions.act_window">
|
||||
<record id="action_report_crm_opportunity_tree" model="ir.actions.act_window">
|
||||
<field name="name">Opportunity by User and Section</field>
|
||||
<field name="res_model">report.crm.opportunity.user</field>
|
||||
<field name="res_model">report.crm.opportunity</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_crm_opportunity_user_graph"/>
|
||||
<field name="search_view_id" ref="view_crm_opportunity_user_filter"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="action_report_crm_l_opportunity_tree1">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_crm_opportunity_tree"/>
|
||||
<field name="act_window_id" ref="action_report_crm_opportunity_tree"/>
|
||||
</record>
|
||||
<menuitem name="Opportinities" id="menu_crm_opportunity_tree" parent="crm.next_id_52"/>
|
||||
<menuitem action="action_report_crm_opportunity_user_tree" id="menu_crm_opportunity_user_tree" parent="menu_crm_opportunity_tree"/>
|
||||
<menuitem action="action_report_crm_opportunity_tree" id="menu_crm_opportunity_user_tree" parent="menu_crm_opportunity_tree"/>
|
||||
|
||||
<!-- # Opportunity by section and category of case -->
|
||||
<!--
|
||||
# Opportunity by section and category of case
|
||||
|
||||
<record id="view_crm_opportunity_categ_tree" model="ir.ui.view">
|
||||
<field name="name">report.crm.opportunity.categ.tree</field>
|
||||
@@ -138,7 +150,7 @@
|
||||
</record>
|
||||
<menuitem action="action_report_crm_opportunity_categ_tree" id="menu_crm_opportunity_categ_tree" parent="menu_crm_opportunity_tree"/>
|
||||
|
||||
<!-- Opportunity by Section -->
|
||||
Opportunity by Section
|
||||
|
||||
<record id="view_report_crm_opportunity_section_tree" model="ir.ui.view">
|
||||
<field name="name">report.crm.opportunity.section.tree</field>
|
||||
@@ -422,5 +434,6 @@
|
||||
<field name="act_window_id" ref="action_report_crm_opportunity_section_categ_type_tree"/>
|
||||
</record>
|
||||
<menuitem action="action_report_crm_opportunity_section_categ_type_tree" id="menu_crm_opportunity_section_categ_type_tree" parent="menu_crm_opportunity_tree"/>
|
||||
-->
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
<filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Stage" icon="terp-sale" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<filter string="Month" icon="terp-sale" domain="[]" context="{'group_by':'month'}"/>
|
||||
<filter string="Category" icon="terp-sale" domain="[]" context="{'group_by':'categ_id'}"/>
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user