From 55329ffbf65caf525ad8fd0f2b4c4fea3a034268 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Tue, 3 May 2011 18:30:24 +0530 Subject: [PATCH 1/2] [FIX] hr_timesheet_*: fix yml warning bzr revid: ara@tinyerp.com-20110503130024-rs4iyy2tjcmyn7y0 --- .../hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml | 2 +- addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml index d48d045cbeb..d7b59c02124 100644 --- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml +++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml @@ -56,7 +56,7 @@ for invoice in invoice_id.invoice_line: product = invoice.product_id.id - product_exp = data['product'] + product_exp = data['product'][0] assert product == product_exp assert aline.invoice_id, "Invoice created, but analytic line wasn't updated." 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 edab4b2d840..2574be443ba 100644 --- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml +++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml @@ -27,7 +27,7 @@ gender: male marital: hr.hr_employee_marital_status_single name: Mark Johnson - user_id: base.user_root + user_id: base.user_demo - I create new Timesheet journal for employee. @@ -69,7 +69,7 @@ date_to: !eval "'%s-05-31' %(datetime.now().year)" name: !eval "'Week-22(%s)' %(datetime.now().year)" state: new - user_id: base.user_root + user_id: base.user_demo employee_id: 'hr_employee_employee0' - Now , at the time of login, I create Attendances and perform "Sign In" action. From 6e53fe76295aac072369b970a897948864321c7d Mon Sep 17 00:00:00 2001 From: skh Date: Fri, 6 May 2011 15:57:10 +0530 Subject: [PATCH 2/2] [FIX] hr_timesheet_sheet: fix yaml to make dynamic dates for new timesheet remove hardcoding bzr revid: skh@tinyerp.com-20110506102710-be1zaqnlwdkd9abf --- .../test/test_hr_timesheet_sheet.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 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 2574be443ba..a02c76ac0e8 100644 --- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml +++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml @@ -62,12 +62,11 @@ - I create my current timesheet for "Mark Johnson". -- +- !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: - date_current: !eval "'%s-05-26' %(datetime.now().year)" - date_from: !eval "'%s-05-01' %(datetime.now().year)" - date_to: !eval "'%s-05-31' %(datetime.now().year)" - name: !eval "'Week-22(%s)' %(datetime.now().year)" + date_current: !eval time.strftime('%Y-%m-%d') + date_from: !eval time.strftime('%Y-%m-01') + name: !eval time.strftime('%U') state: new user_id: base.user_demo employee_id: 'hr_employee_employee0' @@ -77,7 +76,7 @@ !record {model: hr.attendance, id: hr_attendance_0}: action: sign_in employee_id: 'hr_employee_employee0' - name: !eval "'%s-05-26 10:08:08' %(datetime.now().year)" + name: !eval time.strftime('%Y-%m-%d')+' '+'%s:%s:%s' %(datetime.now().hour,datetime.now().minute,datetime.now().second) - At the time of logout, I create attendance and perform "Sign Out". @@ -85,7 +84,7 @@ !record {model: hr.attendance, id: hr_attendance_1}: action: sign_out employee_id: 'hr_employee_employee0' - name: !eval "'%s-05-26 15:10:55' %(datetime.now().year)" + name: !eval time.strftime('%Y-%m-%d')+' '+'%s:%s:%s' %(datetime.now().hour+3,datetime.now().minute,datetime.now().second) - I create Timesheet Entry for time spend on today work. @@ -94,7 +93,7 @@ !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: timesheet_ids: - account_id: account.analytic_sednacom - date: !eval "'%s-05-26' %(datetime.now().year)" + date: !eval time.strftime('%Y-%m-%d') name: 'Develop yaml for hr module' unit_amount: 3.00 amount: -90.00 @@ -125,7 +124,7 @@ !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: timesheet_ids: - account_id: account.analytic_sednacom - date: !eval "'%s-05-26' %(datetime.now().year)" + date: !eval time.strftime('%Y-%m-%d') name: 'Develop yaml for hr module' unit_amount: 2.0 amount: -90.00