Skip to content
Snippets Groups Projects
Commit 8d8ce845 authored by Lionel Sausin's avatar Lionel Sausin
Browse files

Fixed timestamp formatting in attendance reports.

Added default value for attendance report wizard.

bzr revid: ls@numerigraphe.fr-20090206101110-e6bnbv6111mp11kh
parent 9014c3f6
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ class report_custom(report_rml):
where att.name between %s and %s and emp.id = %s
order by att.name
'''
cr.execute(sql, (today, tomor, employee_id))
cr.execute(sql, (today.strftime('%Y-%m-%d %H:%M:%S'), tomor.strftime('%Y-%m-%d %H:%M:%S'), employee_id))
attendences = cr.dictfetchall()
wh = 0
# Fake sign ins/outs at week ends, to take attendances across week ends into account
......
......@@ -75,7 +75,7 @@ class report_custom(report_rml):
order by att.name
'''
for idx in range(7):
cr.execute(sql, (monday, monday + DateTime.RelativeDateTime(days=idx+1), employee_id))
cr.execute(sql, (monday.strftime('%Y-%m-%d %H:%M:%S'), (monday + DateTime.RelativeDateTime(days=idx+1)).strftime('%Y-%m-%d %H:%M:%S'), employee_id))
attendances = cr.dictfetchall()
week_wh = {}
# Fake sign ins/outs at week ends, to take attendances across week ends into account
......
......@@ -31,15 +31,26 @@ _date_form = '''<?xml version="1.0"?>
</form>'''
_date_fields = {
'month' : {'string' : 'Month', 'type' : 'selection', 'selection' : [(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], 'required':True },
'year' : {'string' : 'Year', 'type' : 'integer', 'required':True, 'default' : lambda *a: time.gmtime()[0]},
'month' : {
'string' : 'Month',
'type' : 'selection',
'selection' : [(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')],
'required':True,
'default' : lambda * a: time.gmtime()[1]
},
'year' : {
'string' : 'Year',
'type' : 'integer',
'required':True,
'default' : lambda * a: time.gmtime()[0]
},
}
class wiz_bymonth(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch':_date_form, 'fields':_date_fields, 'state':[('print','Print Timesheet'),('end','Cancel')]}
'result': {'type': 'form', 'arch':_date_form, 'fields':_date_fields, 'state':[('print', 'Print Timesheet'), ('end', 'Cancel')]}
},
'print': {
'actions': [],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment