[IMP] improves the HR recruitment analysis view (reporting) by using the new graph view in pivot mode (addon hr_recruitment)

bzr revid: ged@openerp.com-20140127092308-g893knucca1ez4cq
This commit is contained in:
Gery Debongnie 2014-01-27 10:23:08 +01:00
parent 939ae651b4
commit 737bb32e58
2 changed files with 12 additions and 21 deletions

View File

@ -34,18 +34,8 @@ class hr_recruitment_report(osv.Model):
_columns = {
'user_id': fields.many2one('res.users', 'User', readonly=True),
'nbr': fields.integer('# of Applications', readonly=True),
# TDE TODO: use MONTHS
'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),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'date_create': fields.date('Create Date', readonly=True),
'date_create': fields.datetime('Create Date', readonly=True),
'date_last_stage_update': fields.datetime('Last Stage Update', readonly=True),
'date_closed': fields.date('Closed', readonly=True),
'job_id': fields.many2one('hr.job', 'Applied Job',readonly=True),
@ -70,7 +60,7 @@ class hr_recruitment_report(osv.Model):
create or replace view hr_recruitment_report as (
select
min(s.id) as id,
date_trunc('day',s.create_date) as date_create,
s.create_date as date_create,
date_trunc('day',s.date_closed) as date_closed,
date_trunc('day',s.date_last_stage_update) as date_last_stage_update,
to_char(s.create_date, 'YYYY') as year,
@ -94,9 +84,6 @@ class hr_recruitment_report(osv.Model):
count(*) as nbr
from hr_applicant s
group by
to_char(s.create_date, 'YYYY'),
to_char(s.create_date, 'MM'),
to_char(s.create_date, 'YYYY-MM-DD') ,
date_trunc('day',s.create_date),
date_trunc('day',s.date_closed),
s.date_open,
@ -117,3 +104,5 @@ class hr_recruitment_report(osv.Model):
""")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -6,8 +6,9 @@
<field name="model">hr.recruitment.report</field>
<field name="arch" type="xml">
<graph string="Recruitment Analysis" type="pivot">
<field name="job_id" type="row"/>
<field name="nbr" type="measure"/>
<field name="stage_id" type="row"/>
<field name="date_create" interval="week" type="col"/>
<field name="date_create" interval="day" type="col"/>
</graph>
</field>
</record>
@ -42,9 +43,10 @@
<filter string="Last Stage" help="Match this group by with a specific stage filter in order to analyse the recruitment process" context="{'group_by':'last_stage_id'}"/>
<filter string="Stage" context="{'group_by':'stage_id'}" />
<filter string="Last Stage Update" context="{'group_by':'date_last_stage_update'}" />
<filter string="Day" name="day" context="{'group_by':'day'}" help="Creation Date"/>
<filter string="Month" context="{'group_by':'month'}" help="Creation Date"/>
<filter string="Year" context="{'group_by':'year'}" help="Creation Date"/>
<filter string="Creation Date (day)" context="{'group_by':'date_create:day'}" help="Creation Date"/>
<filter string="Creation Date (week)" context="{'group_by':'date_create:week'}" help="Creation Date"/>
<filter string="Creation Date (month)" context="{'group_by':'date_create:month'}" help="Creation Date"/>
<filter string="Creation Date (year)" context="{'group_by':'date_create:year'}" help="Creation Date"/>
</group>
</search>
</field>
@ -55,7 +57,7 @@
<field name="res_model">hr.recruitment.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph</field>
<field name="context">{'search_default_year':1,'search_default_month':1,'search_default_department':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_hr_recruitment_report_search"/>
</record>
<menuitem action="action_hr_recruitment_report_all" id="menu_hr_recruitment_report_all" parent="hr.menu_hr_reporting" sequence="0"/>