bzr revid: sbh@tinyerp.com-20100303090425-tm6e52l4in60svap
This commit is contained in:
sbh (Open ERP)
2010-03-03 14:34:25 +05:30
15 changed files with 185 additions and 363 deletions
+2 -1
View File
@@ -411,7 +411,8 @@
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="project_id" select="1" widget="selection" default="context.get('project_id', False)">
<filter domain="[('manager_id','=',False)]" help="Unassigned Project" icon="terp-project"/>
<filter domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-project"/>
<filter domain="[('project_id','=',False)]" help="Tasks not assigned to a project" icon="terp-project"/>
</field>
<field name="user_id" select="1" widget="selection">
<filter domain="[('user_id','=',uid)]" help="My Tasks" icon="gtk-execute" default="1"/>
+3 -3
View File
@@ -259,8 +259,8 @@ class project(osv.osv):
_inherit = "project.project"
_columns = {
'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases")
'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases"),
'resource_calendar_id': fields.many2one('resource.calendar', 'Working Time', help="Timetable working hours to adjust the gantt diagram report"),
}
project()
@@ -290,7 +290,7 @@ class task(osv.osv):
hrs = planned / (float(occupation_rate) * resource_obj.time_efficiency)
calendar_id = resource_obj.calendar_id.id
else:
hrs = float(planned / occupation_rate)
hrs = float(planned / float(occupation_rate))
calendar_id = project_pool.browse(cr, uid, project).resource_calendar_id .id
work_times = resource_calendar.interval_get(cr, uid, calendar_id or False, dt_start, hrs or 0.0, resource_id or False)
result['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
+2 -2
View File
@@ -24,8 +24,8 @@
'name': 'CRM Management - Reporting',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'description': """A module that adds new reports based on CRM cases.
Case By section, Case By category""",
'description': """A module that adds new reports based on Leads, Opportunities, Phonecalls, Claims, FunRising.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['crm'],
+32 -33
View File
@@ -34,12 +34,44 @@ class report_crm_case(osv.osv):
_name = "report.crm.case"
_description = "Cases and section"
_auto = False
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:
model_name = self._name.split('report.')
if len(model_name) < 2:
res[case.id] = 0.0
else:
model_name = model_name[1]
cr.execute("select count(*) from crm_case_log l, ir_model m where l.model_id=m.id and m.model = '%s'" , model_name)
logs = cr.fetchone()[0]
avg_ans = logs / case.nbr_cases
res[case.id] = avg_ans
return res
_columns = {
'name': fields.char('Year',size=64,required=False, 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, 'Status', size=16, readonly=True),
'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"),
'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),
}
@@ -62,39 +94,6 @@ class report_crm_case(osv.osv):
)""")
report_crm_case()
class report_crm_case_section(osv.osv):
_name = "report.crm.case.section"
_description = "Cases by Section"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, readonly=True),
# 'user_id':fields.many2one('res.users', 'User', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
'nbr_cases': fields.integer('# of Cases', 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),
}
_order = 'name desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_case_section')
cr.execute("""
create or replace view report_crm_case_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
from
crm_case c
group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'), c.section_id
)""")
report_crm_case_section()
class report_crm_case_service_dashboard(osv.osv):
_name = "report.crm.case.service.dashboard"
_description = "Report of Closed and Open CRM Cases within past 15 days"
+5 -9
View File
@@ -1,16 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Claim by user and section
-->
<data>
<record id="view_report_crm_claim_tree" model="ir.ui.view">
<field name="name">report.crm.claim.tree</field>
<field name="model">report.crm.claim</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Claim">
<tree string="Claims">
<field name="name" />
<field name="month"/>
<field name="nbr" string="#Claim"/>
@@ -66,7 +63,7 @@
<record id="action_report_crm_claim" model="ir.actions.act_window">
<field name="name">Claim</field>
<field name="name">Claims</field>
<field name="res_model">report.crm.claim</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
@@ -83,15 +80,14 @@
</record>
<record model="ir.actions.act_window.view" id="action_report_crm_claim_graph">
<field name="sequence" eval="2"/>
<field name="sequence" eval="1"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_crm_claim_graph"/>
<field name="act_window_id" ref="action_report_crm_claim"/>
</record>
<menuitem name="Claim" action="action_report_crm_claim" id="menu_crm_claim_user_tree" parent="crm.next_id_52"/>
<menuitem name="Claim" id="menu_crm_claim_tree" action="action_report_crm_claim" parent="crm.next_id_52"/>
</data>
+4 -60
View File
@@ -3,7 +3,6 @@ import tools
class report_crm_fundraising(osv.osv):
_name = "report.crm.fundraising"
_description = "Fundraising by user and section"
_auto = False
_inherit = "report.crm.case"
_columns = {
@@ -29,6 +28,9 @@ class report_crm_fundraising(osv.osv):
c.categ_id,
c.stage_id,
count(*) as nbr,
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*probability)::decimal(16,2) as amount_revenue_prob,
@@ -39,62 +41,4 @@ class report_crm_fundraising(osv.osv):
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.stage_id
)""")
report_crm_fundraising()
class report_crm_fundraising_section(osv.osv):
_name = "report.crm.fundraising.section"
_description = "Fundraising 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_fundraising 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_fundraising_section')
cr.execute("""
create or replace view report_crm_fundraising_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_fundraising c
group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'),c.section_id
)""")
report_crm_fundraising_section()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -47,7 +47,7 @@
<field name="model">report.crm.fundraising</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Fundraising by User and Section" type="bar">
<graph orientation="horizontal" string="Fundraising" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
@@ -76,14 +76,20 @@
</record>
<record model="ir.actions.act_window.view" id="action_report_crm_phonecall_tree">
<record model="ir.actions.act_window.view" id="action_report_crm_fundrising_tree">
<field name="sequence" eval="2"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_crm_fundraising_tree"/>
<field name="act_window_id" ref="action_report_crm_fundraising"/>
</record>
<menuitem name="Fundraising" action="action_report_crm_fundraising" id="menu_crm_fundraising_user_tree" parent="crm.next_id_52"/>
</record>
<record model="ir.actions.act_window.view" id="action_report_crm_fundrising_graph">
<field name="sequence" eval="1"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_crm_fundraising_graph"/>
<field name="act_window_id" ref="action_report_crm_fundraising"/>
</record>
<menuitem name="Fundraising" action="action_report_crm_fundraising" id="menu_crm_fundraising_tree" parent="crm.next_id_52"/>
</data>
</openerp>
+3 -59
View File
@@ -24,69 +24,13 @@ class report_crm_lead(osv.osv):
c.section_id,
c.categ_id,
count(*) as nbr,
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_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
)""")
report_crm_lead()
#
#class report_crm_lead_section(osv.osv):
# _name = "report.crm.lead.section"
# _description = "Leads 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_lead 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_lead_section')
# cr.execute("""
# create or replace view report_crm_lead_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_lead c
# group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'),c.section_id
# )""")
#report_crm_lead_section()
#
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:=======
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1 -2
View File
@@ -78,13 +78,12 @@
</record>
<record model="ir.actions.act_window.view" id="action_report_crm_lead_graph">
<field name="sequence" eval="2"/>
<field name="sequence" eval="1"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_crm_lead_graph"/>
<field name="act_window_id" ref="action_report_crm_lead"/>
</record>
<menuitem name="Leads" id="menu_crm_leads_tree" parent="crm.next_id_52" action="action_report_crm_lead"/>
</data>
</openerp>
+6 -60
View File
@@ -4,14 +4,15 @@ import tools
class report_crm_opportunity(osv.osv):
_name = "report.crm.opportunity"
_auto = False
_inherit = "report.crm.case"
_inherit = "report.crm.case"
_columns = {
'probability': fields.float('Avg. Probability', readonly=True),
'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),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"),
'stage_id':fields.many2one('crm.case.stage', 'Stage', 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),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_opportunity')
@@ -27,6 +28,9 @@ class report_crm_opportunity(osv.osv):
c.categ_id,
c.stage_id,
count(*) as nbr,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
sum(planned_revenue) as amount_revenue,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
@@ -36,62 +40,4 @@ class report_crm_opportunity(osv.osv):
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()
#
#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()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -78,7 +78,17 @@
<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>
=======
</record>
<record model="ir.actions.act_window.view" id="action_report_crm_opportunity_graph">
<field name="sequence" eval="1"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_crm_opportunity_graph"/>
<field name="act_window_id" ref="action_report_crm_opportunity"/>
</record>
>>>>>>> MERGE-SOURCE
<menuitem name="Opportinities" action="action_report_crm_opportunity" id="menu_crm_opportunity_tree" parent="crm.next_id_52"/>
</data>
</openerp>
+4 -58
View File
@@ -22,68 +22,14 @@ class report_crm_phonecall(osv.osv):
c.user_id,
c.section_id,
c.categ_id,
count(*) as nbr,
count(*) as nbr,
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_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
)""")
report_crm_phonecall()
class report_crm_phonecall_section(osv.osv):
_name = "report.crm.phonecall.section"
_description = "Phone calls 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_phonecall 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_phonecall_section')
cr.execute("""
create or replace view report_crm_phonecall_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_phonecall c
group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'),c.section_id
)""")
report_crm_phonecall_section()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -52,7 +52,7 @@
<field name="model">report.crm.phonecall</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Cases by User">
<search string="Search">
<group col="16" colspan="8">
<filter string="My Cases" icon="terp-hr" domain="[('user_id','=',uid)]" help="My cases by section"/>
<separator orientation="vertical"/>
@@ -95,9 +95,16 @@
<field name="view_mode">tree</field>
<field name="view_id" ref="view_crm_phonecall_tree"/>
<field name="act_window_id" ref="action_report_crm_phonecall"/>
</record>
<menuitem name="Phone Calls" action="action_report_crm_phonecall" id="menu_crm_phonecall_tree" parent="crm.next_id_52"/>
</record>
<record model="ir.actions.act_window.view" id="action_report_crm_phonecall_graph">
<field name="sequence" eval="1"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_crm_phonecall_graph"/>
<field name="act_window_id" ref="action_report_crm_phonecall"/>
</record>
<menuitem name="Phone Calls" action="action_report_crm_phonecall" id="menu_crm_phonecalls_tree" parent="crm.next_id_52"/>
</data>
</openerp>
+6 -65
View File
@@ -1,17 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Cases by user and section
-->
<data>
<record id="view_crm_case_tree" model="ir.ui.view">
<field name="name">report.crm.case.tree</field>
<field name="model">report.crm.case</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Cases and Section">
<tree string="Cases">
<field name="name" />
<field name="month"/>
<field name="user_id"/>
@@ -26,7 +22,7 @@
<field name="model">report.crm.case</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Cases by User and Section">
<form string="Cases">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="user_id" select="1"/>
@@ -55,7 +51,7 @@
<field name="model">report.crm.case</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Cases by User">
<search string="Search">
<group col="16" colspan="8">
<filter string="My Cases" icon="terp-hr" domain="[('user_id','=',uid)]" help="My cases by section"/>
<separator orientation="vertical"/>
@@ -90,7 +86,7 @@
<record id="action_report_crm_case_tree" model="ir.actions.act_window">
<field name="name">Cases by User and Section</field>
<field name="name">Cases</field>
<field name="res_model">report.crm.case</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
@@ -106,62 +102,7 @@
<act_window domain="[('section_id', '=', active_id)]" id="act_crm_case_section_2_report_crm_case_categ" name="Monthly cases by section" res_model="report.crm.case" src_model="crm.case.section"/>
<!-- Cases by Section -->
<record id="view_report_crm_case_section_tree" model="ir.ui.view">
<field name="name">report.crm.case.section.tree</field>
<field name="model">report.crm.case.section</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Cases by Section">
<field name="name" select="1"/>
<field name="section_id" select="1"/>
<field name="month" select="1"/>
<field name="nbr_cases" select="1"/>
<field name="avg_answers"/>
</tree>
</field>
</record>
<record id="view_report_crm_case_section_graph" model="ir.ui.view">
<field name="name">report.crm.case.section.graph</field>
<field name="model">report.crm.case.section</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Cases by Section" type="bar">
<field name="name"/>
<field name="nbr_cases" operator="+"/>
</graph>
</field>
</record>
<record id="view_report_crm_case_section_filter" model="ir.ui.view">
<field name="name">report.crm.case.section.select</field>
<field name="model">report.crm.case.section</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Cases by Section">
<group col="8" colspan="4">
<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"/>
<field name="name" select="1"/>
<field name="section_id" select="1"/>
<field name="month" select="1"/>
<field name="nbr_cases" select="1"/>
</group>
</search>
</field>
</record>
<record id="action_report_crm_case_section_tree" model="ir.actions.act_window">
<field name="name">Cases by Section</field>
<field name="res_model">report.crm.case.section</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="search_view_id" ref="view_report_crm_case_section_filter"/>
</record>
<!-- Closed & Open CRM Case view for Random Activities dashboard -->
+83
View File
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Example employee -->
<record id="timesheet_group1" model="resource.calendar">
<field name="name">38 Hours/Week</field>
</record>
<record model="resource.calendar.week">
<field name="name">Monday morning</field>
<field name="dayofweek">0</field>
<field name="hour_from">08</field>
<field name="hour_to">12</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
<record model="resource.calendar.week">
<field name="name">Monday evening</field>
<field name="dayofweek">0</field>
<field name="hour_from">13</field>
<field name="hour_to">18</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
<record model="resource.calendar.week">
<field name="name">Tuesday morning</field>
<field name="dayofweek">1</field>
<field name="hour_from">08</field>
<field name="hour_to">12</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
<record model="resource.calendar.week">
<field name="name">Tuesday evening</field>
<field name="dayofweek">1</field>
<field name="hour_from">13</field>
<field name="hour_to">18</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
<record model="resource.calendar.week">
<field name="name">Wednesday morning</field>
<field name="dayofweek">2</field>
<field name="hour_from">08</field>
<field name="hour_to">12</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
<record model="resource.calendar.week">
<field name="name">Wednesday evening</field>
<field name="dayofweek">2</field>
<field name="hour_from">13</field>
<field name="hour_to">18</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
<record model="resource.calendar.week">
<field name="name">Thursday morning</field>
<field name="dayofweek">3</field>
<field name="hour_from">08</field>
<field name="hour_to">12</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
<record model="resource.calendar.week">
<field name="name">Thursday evening</field>
<field name="hour_from">13</field>
<field name="hour_to">18</field>
<field name="dayofweek">3</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
<record model="resource.calendar.week">
<field name="name">Friday morning</field>
<field name="dayofweek">4</field>
<field name="hour_from">08</field>
<field name="hour_to">12</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
<record model="resource.calendar.week">
<field name="name">Friday evening</field>
<field name="dayofweek">4</field>
<field name="hour_from">13</field>
<field name="hour_to">18</field>
<field name="calendar_id" ref="timesheet_group1"/>
</record>
</data>
</openerp>