Comment 2 for bug 271786

Revision history for this message
Didrik Pinte (dpinte) wrote :

Same problem in bin/addons/hr/report/timesheet.py.

At ligne 100, the query should use the same typecast :

    sql = '''
    select t.hour_from, t.hour_to
    from hr_timesheet as t
      inner join (hr_timesheet_group as g inner join hr_timesheet_employee_rel as rel
               on rel.tgroup_id = g.id and rel.emp_id = %s)
      on t.tgroup_id = g.id
    where dayofweek = CAST(%s AS VARCHAR)
       and date_from = (select max(date_from)
            from hr_timesheet inner join (hr_timesheet_employee_rel
                  inner join hr_timesheet_group
                  on hr_timesheet_group.id = hr_timesheet_employee_rel.tgroup_id
                   and hr_timesheet_employee_rel.emp_id = %s)
               on hr_timesheet.tgroup_id = hr_timesheet_group.id
            where dayofweek = CAST(%s AS VARCHAR) and date_from <= '%s')
    order by date_from desc
    '''