~hr-core-editors/openerp-hr/6.1

« back to all changes in this revision

Viewing changes to hr_interview/report/candidate_summary.py

[MRG] 6.1-modules-from-other-projects (hr_skill kept unchanged on conflict resolution)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- encoding: utf-8 -*-
2
 
##############################################################################
3
 
#
4
 
#    OpenERP, Open Source Management Solution    
 
2
#
 
3
#
 
4
#    OpenERP, Open Source Management Solution
5
5
#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6
6
#    $Id$
7
7
#
18
18
#    You should have received a copy of the GNU General Public License
19
19
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
20
#
21
 
##############################################################################
 
21
#
22
22
 
23
23
import time
24
24
from report import report_sxw
25
25
import datetime
26
26
import mx.DateTime
27
27
 
 
28
 
28
29
class candidate_summary(report_sxw.rml_parse):
29
30
 
30
31
    def __init__(self, cr, uid, name, context):
31
32
        super(candidate_summary, self).__init__(cr, uid, name, context)
32
 
        self.localcontext.update( {
 
33
        self.localcontext.update({
33
34
            'time': time,
34
35
            'get_education': self._get_education,
35
 
            'get_scheduled_date':self._get_schedule_date,
 
36
            'get_scheduled_date': self._get_schedule_date,
36
37
        })
37
 
        
 
38
 
38
39
    def _get_education(self, edu_type):
39
 
        edu_list = [("be_ce","BE Computers"),("be_it","BE IT"),("bsc_it","BSc IT"),("bca","BCA"),("btech_ce","BTech Computers"),("btech_it","BTech IT"),("mca","MCA"),("msc_it","MSc IT"),("mtech_ce","MTech Computers"),("other","Other")]
40
 
        edu = [x[1] for x in edu_list if x[0]==str(edu_type) ]
 
40
        edu_list = [(
 
41
            "be_ce", "BE Computers"), ("be_it", "BE IT"), ("bsc_it", "BSc IT"), ("bca", "BCA"), ("btech_ce", "BTech Computers"),
 
42
            ("btech_it", "BTech IT"), ("mca", "MCA"), ("msc_it", "MSc IT"), ("mtech_ce", "MTech Computers"), ("other", "Other")]
 
43
        edu = [x[1] for x in edu_list if x[0] == str(edu_type)]
41
44
        return edu[0]
42
 
    
 
45
 
43
46
    def _get_schedule_date(self, sch_time):
44
47
        if len(sch_time) > 5:
45
 
            dt = mx.DateTime.strptime(str(sch_time),"%m/%d/%Y %H:%M:%S")
 
48
            dt = mx.DateTime.strptime(str(sch_time), "%m/%d/%Y %H:%M:%S")
46
49
            sch_dt = dt.strftime('%B %d,%Y at %H:%M %p')
47
 
        else :
48
 
            sch_dt=""
 
50
        else:
 
51
            sch_dt = ""
49
52
        return sch_dt
50
53
 
51
 
report_sxw.report_sxw('report.candidate.summary', 'hr.interview', 'addons/hr_interview/report/candidate_summary.rml',parser=candidate_summary,header=False)
 
54
report_sxw.report_sxw('report.candidate.summary', 'hr.interview',
 
55
                      'addons/hr_interview/report/candidate_summary.rml', parser=candidate_summary, header=False)
52
56
 
53
57
 
54
58
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
55