[FIX] use string instead of numeric format for day of week

lp bug: https://launchpad.net/bugs/289035 fixed

bzr revid: christophe@tinyerp.com-20081120153825-ksfmm1rtrr359c6c
This commit is contained in:
Christophe Simonis 2008-11-20 16:38:25 +01:00
parent 1557e18e44
commit d126387243
2 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ class hr_timesheet_group(osv.osv):
cycle = 0
result = []
while todo>0:
cr.execute('select hour_from,hour_to from hr_timesheet where dayofweek=%s and tgroup_id=%d order by hour_from', (dt_from.day_of_week,id))
cr.execute("select hour_from,hour_to from hr_timesheet where dayofweek='%s' and tgroup_id=%d order by hour_from", (dt_from.day_of_week,id))
for (hour_from,hour_to) in cr.fetchall():
h1,m1 = map(int,hour_from.split(':'))
h2,m2 = map(int,hour_to.split(':'))

View File

@ -94,14 +94,14 @@ class report_custom(report_rml):
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 = %s
where dayofweek = '%s'
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 = %s and date_from <= '%s')
where dayofweek = '%s' and date_from <= '%s')
order by date_from desc
'''
isPH = False