From d0cfb16cd0de67366ed5374f7c8f856c5a6dfa41 Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 7 Jan 2011 10:49:41 +0530 Subject: [PATCH 1/2] [IMP] hr_timesheet:changed static date of 2010 to current date value in test_hr_timesheet.yml bzr revid: mtr@mtr-20110107051941-ve972vw2n9hh42ep --- addons/hr_timesheet/test/test_hr_timesheet.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/hr_timesheet/test/test_hr_timesheet.yml b/addons/hr_timesheet/test/test_hr_timesheet.yml index d472263150b..c7954858757 100755 --- a/addons/hr_timesheet/test/test_hr_timesheet.yml +++ b/addons/hr_timesheet/test/test_hr_timesheet.yml @@ -79,7 +79,7 @@ !record {model: hr.attendance, id: hr_attendance_0}: action: sign_in employee_id: 'hr_employee_fracline1' - name: '2010-05-26 10:08:08' + name: !eval time.strftime('%Y-%m-%d')+' '+'%s:%s:%s' %(datetime.now().hour-2,datetime.now().minute,datetime.now().second) - I create attendance and perform "Sign Out" action. @@ -87,7 +87,7 @@ !record {model: hr.attendance, id: hr_attendance_1}: action: sign_out employee_id: 'hr_employee_fracline1' - name: '2010-05-26 15:10:55' + name: !eval time.strftime('%Y-%m-%d')+' '+'%s:%s:%s' %(datetime.now().hour-1,datetime.now().minute,datetime.now().second) - On "Sign In/Sign Out by Project" wizard i click on "Sign In/Sign Out" button of this wizard. @@ -99,8 +99,10 @@ I select start date and Perform start work on project. - !python {model: hr.sign.in.project}: | + import time + from datetime import datetime, date, timedelta uid = ref('test_timesheet_user1') - new_id = self.create(cr, uid, {'emp_id': ref('hr_employee_fracline1'), 'name': 'Francline', 'server_date': '2010-06-08 19:50:54', 'state': 'absent'}) + new_id = self.create(cr, uid, {'emp_id': ref('hr_employee_fracline1'), 'name': 'Francline', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'}) self.sign_in_result(cr, uid, [new_id], context) - @@ -130,7 +132,7 @@ import time from datetime import datetime, date, timedelta uid = ref('test_timesheet_user1') - new_id = self.create(cr, uid, {'account_id': ref('account_analytic_account_project0'), 'analytic_amount': 7.0, 'date': (datetime.now()+timedelta(1)).strftime('%Y-%m-%d %H:%M:%S'), 'date_start': '2010-06-05 16:37:00', 'info': 'Create Yaml for hr module', 'name': 'Francline', 'server_date': '2010-06-09 16:40:15', 'state': 'absent'}) + new_id = self.create(cr, uid, {'account_id': ref('account_analytic_account_project0'), 'analytic_amount': 7.0, 'date': (datetime.now()+timedelta(1)).strftime('%Y-%m-%d %H:%M:%S'), 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module', 'name': 'Francline', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'}) self.sign_out_result_end(cr, uid, [new_id], context) - | From c1b65fd3b9ab2e8aec1eae6aba46142c66aa2677 Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 7 Jan 2011 11:02:26 +0530 Subject: [PATCH 2/2] [IMP] hr_timesheet:removed unused import library of datetime from test_hr_timesheet.yml bzr revid: mtr@mtr-20110107053226-0l54q6lplok65p75 --- addons/hr_timesheet/test/test_hr_timesheet.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/hr_timesheet/test/test_hr_timesheet.yml b/addons/hr_timesheet/test/test_hr_timesheet.yml index c7954858757..c28eeab3439 100755 --- a/addons/hr_timesheet/test/test_hr_timesheet.yml +++ b/addons/hr_timesheet/test/test_hr_timesheet.yml @@ -100,7 +100,6 @@ - !python {model: hr.sign.in.project}: | import time - from datetime import datetime, date, timedelta uid = ref('test_timesheet_user1') new_id = self.create(cr, uid, {'emp_id': ref('hr_employee_fracline1'), 'name': 'Francline', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'}) self.sign_in_result(cr, uid, [new_id], context)