1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##############################################################################
23 from osv import fields,osv
24 from hr_recruitment import hr_recruitment
26 class hr_recruitment_report(osv.osv):
27 _name = "hr.recruitment.report"
28 _description = "Recruitments Statistics"
29 _inherit = "crm.case.report"
33 'year': fields.char('Year', size=4, readonly=True),
34 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
35 ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
36 ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
37 'date': fields.datetime('Date', readonly=True),
38 'date_closed': fields.datetime('Closed', readonly=True),
39 'job_id': fields.many2one('hr.job', 'Applied Job',readonly=True),
40 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]",readonly=True),
41 'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
42 'department_id':fields.many2one('hr.department','Department',readonly=True),
43 'priority': fields.selection(hr_recruitment.AVAILABLE_PRIORITIES, 'Appreciation'),
48 tools.drop_view_if_exists(cr, 'hr_recruitment_report')
50 create or replace view hr_recruitment_report as (
53 date_trunc('day',s.date) as date,
54 date_trunc('day',s.date_closed) as date_closed,
55 to_char(s.date, 'YYYY') as year,
56 to_char(s.date, 'MM') as month,
68 to_char(s.date, 'YYYY'),
69 to_char(s.date, 'MM'),
70 date_trunc('day',s.date),
71 date_trunc('day',s.date_closed),
82 hr_recruitment_report()