[IMP] board_crm_configuration: Improved views according to the new objects added in report_crm.
bzr revid: uco@tinyerp.co.in-20100120104658-ajiv9q3rwqgb93ki
This commit is contained in:
@@ -37,7 +37,7 @@ This module implements a dashboard for CRM that includes:
|
||||
'depends': ['board', 'crm', 'report_crm'],
|
||||
'update_xml': ['board_crm_statistical_view.xml', 'board_crm_view.xml'],
|
||||
'demo_xml': ['board_crm_demo.xml'],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0071599098909',
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
-->
|
||||
<record model="ir.ui.view" id="view_crm_lead_stage_graph1">
|
||||
<field name="name">Leads By Stage - Graph</field>
|
||||
<field name="model">report.crm.case.section.stage</field>
|
||||
<field name="model">report.crm.lead.section.stage</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Leads By Stage" type="pie">
|
||||
@@ -17,12 +17,12 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_crm_case_categ_graph">
|
||||
<field name="name">report.crm.case.categ.graph</field>
|
||||
<field name="model">report.crm.case.categ</field>
|
||||
<record model="ir.ui.view" id="view_crm_opportunity_categ_graph">
|
||||
<field name="name">report.crm.opportunity.categ.graph</field>
|
||||
<field name="model">report.crm.opportunity.categ</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Cases by Sections and Categories" type="bar" orientation="horizontal">
|
||||
<graph string="Opportunity by Sections and Categories" type="bar" orientation="horizontal">
|
||||
<field name="categ_id"/>
|
||||
<field name="nbr" operator="+"/>
|
||||
<field name="state" group="True"/>
|
||||
@@ -31,34 +31,27 @@
|
||||
</record>
|
||||
|
||||
<act_window name="Opportunities By Categories"
|
||||
domain="[('section_id', '=', 'Opportunities'),('state','!=','done'),('state','!=','cancel')]"
|
||||
res_model="report.crm.case.categ"
|
||||
domain="[('state','!=','done'),('state','!=','cancel')]"
|
||||
res_model="report.crm.opportunity.categ"
|
||||
view_type="form"
|
||||
view_mode="graph,tree,form"
|
||||
view_id="view_crm_case_categ_graph"
|
||||
view_id="view_crm_opportunity_categ_graph"
|
||||
id="act_oppor_categ"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_leads_state">
|
||||
<field name="res_model">report.crm.case.section.stage</field>
|
||||
<field name="res_model">report.crm.lead.section.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree,form</field>
|
||||
<field name="view_id" ref="view_crm_lead_stage_graph1"/>
|
||||
<field name="domain">[('section_id', '=', 'Leads'),('state','!=','done'),('state','!=','cancel')]</field>
|
||||
<field name="domain">[('state','!=','done'),('state','!=','cancel')]</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Jobs Requests Of The Month by Applied Job"
|
||||
domain="[('section_id', '=', 'Jobs'),('name','=',time.strftime('%Y-%m-01')),('state','!=','done'),('state','!=','cancel')]"
|
||||
res_model="report.crm.case.categ"
|
||||
view_type="form"
|
||||
view_mode="graph,tree,form"
|
||||
view_id="view_crm_case_categ_graph"
|
||||
id="act_jobs_categ"/>
|
||||
|
||||
<act_window name="Leads Of The Month By User"
|
||||
domain="[('section_id', '=', 'Leads'),('name','=',time.strftime('%Y-%m-01')),('state','!=','cancel')]"
|
||||
res_model="report.crm.case.user"
|
||||
domain="[('name','=',time.strftime('%Y-%m-01')),('state','!=','cancel')]"
|
||||
res_model="report.crm.lead.user"
|
||||
view_type="form"
|
||||
view_mode="graph,tree,form"
|
||||
view_id="view_crm_lead_stage_graph1"
|
||||
id="act_leads_month_user"/>
|
||||
|
||||
<record model="ir.ui.view" id="board_crm_statistical_form">
|
||||
@@ -84,11 +77,6 @@
|
||||
|
||||
</child1>
|
||||
<child2>
|
||||
<action
|
||||
string="Jobs Requests Of The Month by Applied Job"
|
||||
name="%(act_jobs_categ)d"
|
||||
colspan="4"/>
|
||||
|
||||
|
||||
<action
|
||||
string="Leads Of The Month By User"
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<record model="board.note.type" id="note_crm_type">
|
||||
<field name="name">CRM Configuration</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_crm_case_user_graph1">
|
||||
<field name="name">crm.case.user.graph1</field>
|
||||
<field name="model">report.crm.case.user</field>
|
||||
|
||||
<record model="ir.ui.view" id="view_crm_opportunity_user_graph1">
|
||||
<field name="name">crm.opportunity.user.graph1</field>
|
||||
<field name="model">report.crm.opportunity.user</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Cases by User and Section" type="pie">
|
||||
<graph string="Opportunities by User and Section" type="pie">
|
||||
<field name="state"/>
|
||||
<field name="nbr" operator="+"/>
|
||||
</graph>
|
||||
@@ -18,21 +18,21 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_my_leads">
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="res_model">crm.lead</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="crm.crm_case_tree_view_leads"/>
|
||||
<field name="domain">[('section_id.name', '=', 'Prospects'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
|
||||
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_my_meetings">
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="res_model">crm.meeting</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="crm.crm_case_tree_view_meet"/>
|
||||
<field name="domain">[('section_id.name', '=', 'Meetings'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
|
||||
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
|
||||
</record>
|
||||
|
||||
|
||||
<act_window name="My Cases"
|
||||
domain="[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]"
|
||||
res_model="crm.case"
|
||||
@@ -41,27 +41,19 @@
|
||||
id="act_my_cases"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_my_leads_stage">
|
||||
<field name="res_model">report.crm.case.section.stage</field>
|
||||
<field name="res_model">report.crm.lead.section.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree,form</field>
|
||||
<field name="view_id" ref="view_crm_lead_stage_graph1"/>
|
||||
<field name="domain">[('section_id.name', '=', 'Leads'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
|
||||
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_sales_pipeline">
|
||||
<field name="res_model">report.crm.case.user</field>
|
||||
<field name="res_model">report.crm.opportunity.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree,form</field>
|
||||
<field name="view_id" ref="view_crm_case_user_graph1"/>
|
||||
<field name="domain">[('section_id.name', '=', 'Opportunities'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="act_jobs_requests">
|
||||
<field name="res_model">report.crm.case.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree,form</field>
|
||||
<field name="view_id" ref="view_crm_case_user_graph1"/>
|
||||
<field name="domain">[('section_id.name','=','Jobs'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
|
||||
<field name="view_id" ref="view_crm_opportunity_user_graph1"/>
|
||||
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="board_crm_form">
|
||||
@@ -86,7 +78,7 @@
|
||||
name="%(act_my_meetings)d"
|
||||
height="150"
|
||||
colspan="4"/>
|
||||
|
||||
|
||||
<action
|
||||
string="My Cases"
|
||||
name="%(act_my_cases)d"
|
||||
|
||||
@@ -158,6 +158,38 @@ class report_crm_case_service_dashboard(osv.osv):
|
||||
)""")
|
||||
report_crm_case_service_dashboard()
|
||||
|
||||
class report_crm_case_section_stage(osv.osv):
|
||||
_name = "report.crm.case.section.stage"
|
||||
_description = "Cases by section and stage"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
|
||||
'nbr': fields.integer('# of Cases', readonly=True),
|
||||
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
|
||||
}
|
||||
_order = 'section_id'
|
||||
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, "report_crm_case_section_stage")
|
||||
cr.execute("""
|
||||
create view report_crm_case_section_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.state,
|
||||
c.section_id,
|
||||
count(*) as nbr
|
||||
from
|
||||
crm_case c
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.user_id, c.state, c.section_id)""")
|
||||
|
||||
report_crm_case_section_stage()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -128,4 +128,40 @@ class report_crm_lead_section(osv.osv):
|
||||
)""")
|
||||
report_crm_lead_section()
|
||||
|
||||
class report_crm_lead_section_stage(osv.osv):
|
||||
_name = "report.crm.lead.section.stage"
|
||||
_description = "Leads by section and stage"
|
||||
_auto = False
|
||||
_inherit = "report.crm.case.section.stage"
|
||||
_columns = {
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]", readonly=True),
|
||||
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]", readonly=True),
|
||||
'amount_revenue': fields.float('Est.Revenue', readonly=True),
|
||||
'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
}
|
||||
_order = 'stage_id, section_id'
|
||||
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, "report_crm_lead_section_stage")
|
||||
cr.execute("""
|
||||
create view report_crm_lead_section_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.state,
|
||||
c.stage_id,
|
||||
c.section_id,
|
||||
c.categ_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_lead c
|
||||
where c.stage_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.categ_id, c.section_id)""")
|
||||
|
||||
report_crm_lead_section_stage()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -187,5 +187,64 @@
|
||||
<field name="search_view_id" ref="view_report_crm_lead_section_filter"/>
|
||||
</record>
|
||||
<menuitem action="action_report_crm_lead_section_tree" id="menu_crm_lead_section_tree" parent="menu_crm_leads_tree"/>
|
||||
|
||||
|
||||
<!-- Cases by section and stage -->
|
||||
<record model="ir.ui.view" id="view_crm_lead_section_stage_tree">
|
||||
<field name="name">Leads Report - Sections and Stage(Tree)</field>
|
||||
<field name="model">report.crm.lead.section.stage</field>
|
||||
<field name="inherit_id" ref="view_crm_case_section_stage_tree"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="nbr" position="after">
|
||||
<field name="categ_id"/>
|
||||
<field name="stage_id" select="2"/>
|
||||
<field name="amount_revenue" select="2"/>
|
||||
<field name="delay_close"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_crm_lead_section_stage_form">
|
||||
<field name="name">Leads Report - Sections and Stage(Form)</field>
|
||||
<field name="model">report.crm.lead.section.stage</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="nbr" position="after">
|
||||
<field name="categ_id"/>
|
||||
<field name="stage_id" select="2"/>
|
||||
<field name="amount_revenue" select="2"/>
|
||||
<field name="delay_close"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_crm_lead_section_stage_graph">
|
||||
<field name="name">Leads Report - Sections and Stage(Graph)</field>
|
||||
<field name="model">report.crm.lead.section.stage</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Leads by Section and Stage" type="bar" orientation="horizontal">
|
||||
<field name="stage_id"/>
|
||||
<field name="amount_revenue" operator="+"/>
|
||||
<field name="section_id" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_crm_lead_section_stage_filter" model="ir.ui.view">
|
||||
<field name="name">Leads Report - Sections and Stage(Select)</field>
|
||||
<field name="model">report.crm.lead.section.stage</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="state" position="before">
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_report_crm_lead_section_stage_tree">
|
||||
<field name="res_model">report.crm.lead.section.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_crm_lead_section_stage_tree"/>
|
||||
<field name="search_view_id" ref="view_crm_lead_section_stage_filter"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -210,6 +210,65 @@
|
||||
<field name="search_view_id" ref="view_report_crm_case_section_filter"/>
|
||||
</record>
|
||||
|
||||
#
|
||||
# Cases by section and stage
|
||||
#
|
||||
<record model="ir.ui.view" id="view_crm_case_section_stage_tree">
|
||||
<field name="name">CRM Report - Sections and Stage(Tree)</field>
|
||||
<field name="model">report.crm.case.section.stage</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Cases by Section and Stage">
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id"/>
|
||||
<field name="nbr"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_crm_case_section_stage_form">
|
||||
<field name="name">CRM Report - Sections and Stage(Form)</field>
|
||||
<field name="model">report.crm.case.section.stage</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Cases by Section and Stage">
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id" select="1" widget="selection"/>
|
||||
<field name="nbr" select="1"/>
|
||||
<field name="state" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_case_section_stage_filter" model="ir.ui.view">
|
||||
<field name="name">CRM Report - Sections and Stage(Select)</field>
|
||||
<field name="model">report.crm.case.section.stage</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Cases by Section and Stage">
|
||||
<group col="8" colspan="4">
|
||||
<filter string="This Year" icon="terp-hr" domain="[('name','=',time.localtime()[0])]" help="Cases by Section and Stage for this year"/>
|
||||
<filter string="This Month" icon="terp-hr" domain="[('month','=',time.localtime()[1])]" help="Cases by Section and Stage for this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="section_id" select="1" widget="selection"/>
|
||||
<field name="nbr" select="1"/>
|
||||
<field name="state" select="1"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_report_crm_case_section_stage_tree">
|
||||
<field name="res_model">report.crm.case.section.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="search_view_id" ref="view_crm_case_section_stage_filter"/>
|
||||
</record>
|
||||
|
||||
<!-- Closed & Open CRM Case view for Random Activities dashboard -->
|
||||
|
||||
<record id="board_view_crm_case_open_dashboard_tree" model="ir.ui.view">
|
||||
|
||||
Reference in New Issue
Block a user