From d013972d7722933f133453e00a1662c313b8c2e0 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Fri, 23 Sep 2011 12:28:17 +0530 Subject: [PATCH] [IMP] hr_timesheet: Improved yaml. bzr revid: uco@tinyerp.com-20110923065817-drhlcx5raa2am1y0 --- .../hr_timesheet/test/test_hr_timesheet.yml | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/addons/hr_timesheet/test/test_hr_timesheet.yml b/addons/hr_timesheet/test/test_hr_timesheet.yml index 16fd59b69ba..30f3930155f 100644 --- a/addons/hr_timesheet/test/test_hr_timesheet.yml +++ b/addons/hr_timesheet/test/test_hr_timesheet.yml @@ -37,14 +37,6 @@ parent_id: 'hr_employee_employee0' user_id: 'test_timesheet_user1' -- - I create Timesheet journal for employee. -- - !record {model: account.analytic.journal, id: analytic_journal}: - code: TS - name: Timesheet Journal - type: general - - I create a product as "Consultancy - Senior Developer". - @@ -103,7 +95,23 @@ 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) - +- + I create a timesheet line manually to check several default values. + I also assign proper date and user for that line. +- + !python {model: hr.analytic.timesheet}: | + import time + uid = ref('test_timesheet_user1') + current_date = time.strftime('%Y-%m-%d') + vals = {'name': 'Worked on project', + 'user_id': ref('test_timesheet_user1'), + 'account_id': ref('account.analytic_project_1_development'), + 'unit_amount': 5.00, + 'journal_id': ref('analytic_journal') + } + line_id = self.create(cr, uid, vals, None) + self.on_change_date(cr, uid, [line_id], current_date) + self.on_change_user_id(cr, uid, [line_id], ref('base.user_root')) - To stop work I click on "Sign In/Sign Out" button of "Sign In/Sign Out by Project" wizard. Which check state in hr attendace form for user. @@ -113,7 +121,6 @@ ids = self.search(cr, uid, [('emp_id', '=', ref('hr_employee_fracline1')),('name', '=', 'Francline')]) self.check_state(cr, uid, ids, {"active_ids": [ref("hr_timesheet.action_hr_timesheet_sign_in")] }) - - I Create an analytic account "Project2". - @@ -136,3 +143,4 @@ - | I can see employee timesheet for particular month using "Employee Timesheet" report. +