~openerp-dev/openobject-addons/acct_prj_hr_logs

« back to all changes in this revision

Viewing changes to hr_attendance/report/attendance_errors.py

  • Committer: pap(openerp)
  • Date: 2010-06-21 05:19:03 UTC
  • mfrom: (3638.1.26 trunk-dev-addons3)
  • Revision ID: pap@tinyerp.co.in-20100621051903-lm0gpjuehqakpntg
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        })
37
37
 
38
38
    def _get_employees(self, emp_ids):
39
 
        emp_obj_list = self.pool.get('hr.employee').browse(self.cr,self.uid,emp_ids)
 
39
        emp_obj_list = self.pool.get('hr.employee').browse(self.cr, self.uid, emp_ids)
40
40
        return emp_obj_list    
41
41
        
42
42
#    def _sign(self, dt):
50
50
#            return dt.strftime(format)
51
51
 
52
52
    def _lst(self, employee_id, dt_from, dt_to, max, *args):
53
 
        self.cr.execute("select name as date, create_date, action, create_date-name as delay from hr_attendance where employee_id=%s and to_char(name,'YYYY-mm-dd')<=%s and to_char(name,'YYYY-mm-dd')>=%s and action in (%s,%s) order by name", (employee_id, dt_to, dt_from, 'sign_in', 'sign_out'))
 
53
        self.cr.execute("select name as date, create_date, action, create_date-name as delay from hr_attendance where employee_id=%s and to_char(name,'YYYY-mm-dd')<=%s and to_char(name,'YYYY-mm-dd')>=%s and action IN (%s,%s) order by name", (employee_id, dt_to, dt_from, 'sign_in', 'sign_out'))
54
54
        res = self.cr.dictfetchall()
55
55
        for r in res:
56
56
            if r['action'] == 'sign_out':
66
66
        return res
67
67
 
68
68
    def _lst_total(self, employee_id, dt_from, dt_to, max, *args):
69
 
        self.cr.execute("select name as date, create_date, action, create_date-name as delay from hr_attendance where employee_id=%s and to_char(name,'YYYY-mm-dd')<=%s and to_char(name,'YYYY-mm-dd')>=%s and action in (%s,%s) order by name", (employee_id, dt_to, dt_from, 'sign_in', 'sign_out'))
 
69
        self.cr.execute("select name as date, create_date, action, create_date-name as delay from hr_attendance where employee_id=%s and to_char(name,'YYYY-mm-dd')<=%s and to_char(name,'YYYY-mm-dd')>=%s and action IN (%s,%s) order by name", (employee_id, dt_to, dt_from, 'sign_in', 'sign_out'))
70
70
        res = self.cr.dictfetchall()
71
71
        if not res:
72
72
            return ('/','/')