From c121f79c60f98b2522a54e9e85f1231dc67945fd Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 18 Jul 2011 13:03:50 +0200 Subject: [PATCH] [FIX] hr_timesheet_sheet: make timesheet test more robust depending on time of execution bzr revid: odo@openerp.com-20110718110350-jn12uvei3h63e8c2 --- addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml index 8800d69f90c..1808c325a07 100644 --- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml +++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml @@ -76,7 +76,7 @@ !record {model: hr.attendance, id: hr_attendance_0}: action: sign_in employee_id: 'hr_employee_employee0' - name: !eval time.strftime('%Y-%m-%d')+' '+'%s:%s:%s' %(datetime.now().hour,datetime.now().minute,datetime.now().second) + name: !eval time.strftime('%Y-%m-%d')+' '+'%s:%s:%s' %(max(0,datetime.now().hour-1),max(0,datetime.now().minute-1),max(0,datetime.now().second-1)) - At the time of logout, I create attendance and perform "Sign Out". @@ -84,7 +84,7 @@ !record {model: hr.attendance, id: hr_attendance_1}: action: sign_out employee_id: 'hr_employee_employee0' - name: !eval time.strftime('%Y-%m-%d')+' '+'%s:%s:%s' %(datetime.now().hour+3,datetime.now().minute,datetime.now().second) + name: !eval time.strftime('%Y-%m-%d')+' '+'%s:%s:%s' %(min(23,datetime.now().hour+2),min(59,datetime.now().minute+1),min(59,datetime.now().second+1)) - I create Timesheet Entry for time spend on today work.