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
26 class hr_evaluation_report(osv.osv):
27 _name = "hr.evaluation.report"
28 _description = "Evaluations Statistics"
32 'create_date': fields.datetime('Create Date', readonly=True),
33 'deadline': fields.date("Deadline", readonly=True),
34 'closed': fields.date("closed", readonly=True),
35 'year': fields.char('Year', size=4, readonly=True),
36 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
37 ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
38 ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
39 'employee_id': fields.many2one('hr.employee', "Employee", readonly=True),
40 'nbr':fields.integer('# of Requests', readonly=True),
41 'state': fields.selection([
43 ('wait','Plan In Progress'),
44 ('progress','Final Validation'),
46 ('cancel','Cancelled'),
47 ], 'State',readonly=True),
49 _order = 'create_date desc'
51 tools.drop_view_if_exists(cr, 'hr_evaluation_report')
53 create or replace view hr_evaluation_report as (
56 s.create_date as create_date,
59 s.date_close as closed,
60 to_char(s.create_date, 'YYYY') as year,
61 to_char(s.create_date, 'MM') as month,
65 hr_evaluation_interview l
67 hr_evaluation_evaluation s on (s.id=l.evaluation_id)
69 s.create_date,s.state,s.employee_id,
73 hr_evaluation_report()