diff --git a/addons/hr_attendance/test/test_hr_attendance.yml b/addons/hr_attendance/test/test_hr_attendance.yml index 5c1132525f5..e4a08476985 100644 --- a/addons/hr_attendance/test/test_hr_attendance.yml +++ b/addons/hr_attendance/test/test_hr_attendance.yml @@ -1,8 +1,8 @@ -- | - In order to test hr_attendance module in OpenERP, I create new attendance and perform Sign In/Sign Out operation. - -- | - First I create Employee "Mark Johnson". +- + In order to test hr_attendance module in OpenERP, I will first create new attendance reasons and perform Sign In/Sign Out operations. + +- + I create a new employee "Mark Johnson". - !record {model: hr.employee, id: hr_employee_employee0}: address_home_id: base.res_partner_address_1 @@ -10,56 +10,56 @@ gender: male name: Mark Johnson user_id: base.user_root - -- | - Given that I have Attendance Reason "Good Morning" for Sign In. -- - !record {model: hr.action.reason, id: hr_action_reason_goodmorning0}: - name: Good Morning + +- + I create a new attendance reason "Login" for Sign In. +- + !record {model: hr.action.reason, id: hr_action_reason_login0}: + name: Login action_type: sign_in -- | - I also create another Attendance Reason for Sign Out. -- - !record {model: hr.action.reason, id: hr_action_reason_goodnight0}: - name: Good Night +- + I create second attendance reason "Logout" for Sign Out. +- + !record {model: hr.action.reason, id: hr_action_reason_logout0}: + name: Logout action_type: sign_out -- | - Now , When I came in office , I create Atendances and perform "Sign In" action with proper reason. -- +- + Now, at the time of login, I create an attendance with "Sign In" action and proper reason. +- !record {model: hr.attendance, id: hr_attendance_0}: action: sign_in - action_desc: 'hr_action_reason_goodmorning0' + action_desc: 'hr_action_reason_login0' employee_id: 'hr_employee_employee0' name: '2010-05-18 19:08:08' -- | - I check that Employee is in "Present" state. - - !assert {model: hr.employee, id: hr_employee_employee0}: + I check that Employee state is "Present". +- + !assert {model: hr.employee, id: hr_employee_employee0}: - state == 'present' - -- | - When I left office , I create attendance and perform "Sign Out". -- + +- + At the time of logout, I create an attendance with "Sign Out" action. +- !record {model: hr.attendance, id: hr_attendance_1}: action: sign_out employee_id: 'hr_employee_employee0' name: '2010-05-18 19:10:55' -- | - I check that Employee is in "Absent" state. - - !assert {model: hr.employee, id: hr_employee_employee0}: - - state == 'absent' + I check that Employee state is Absent. +- + !assert {model: hr.employee, id: hr_employee_employee0}: + - state == 'absent' -- | - I can also fill my attendance using "Sign In/Sign Out" wizard. -- +- + I will use "Sign In/Sign Out" wizard for attendances. +- !record {model: hr.sign.in.out, id: hr_sign_in_out_markjohnson0}: name: Mark Johnson state: absent - -- | - I click on "Sign In" button of this wizard to perform present action. -- + +- + I click on "Sign In" button of this wizard to login. +- !python {model: hr.sign.in.out}: | obj_attendance = self.pool.get('hr.employee') emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Mark Johnson")]) @@ -68,21 +68,21 @@ self.write(cr, uid, [ref('hr_sign_in_out_markjohnson0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]}) self.si_check(cr, uid, [ref("hr_sign_in_out_markjohnson0")], {"active_id": ref("hr_employee_employee0")}) -- | - I check that Employee is in "Present" state. +- + I check that Employee state is "Present". - !assert {model: hr.employee, id: hr_employee_employee0}: - - state == 'present' - -- | - I forgot to "Sign Out" in Yesterday and want to sign in Today using This wizard. -- + - state == 'present' + +- + I forgot to "Sign Out" Yesterday and want to sign in Today using This wizard. +- !record {model: hr.sign.in.out, id: hr_sign_in_out_markjohnson0}: name: Mark Johnson state: present -- | - I click on "Sign In" button of this wizard. that will Open new form which ask for Last Sign Out date. -- +- + I click on "Sign In" button of this wizard, this will Open a new form which ask for Last Sign Out date. +- !python {model: hr.sign.in.out}: | obj_attendance = self.pool.get('hr.employee') emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Mark Johnson")]) @@ -90,15 +90,15 @@ employee = obj_attendance.read(cr, uid, emp_id)[0] self.write(cr, uid, [ref('hr_sign_in_out_markjohnson0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]}) self.si_check(cr, uid, [ref("hr_sign_in_out_markjohnson0")]) -- | - I select Last Sign Out date in "hr sign out ask" wizard. -- +- + I select Last Sign Out date. +- !record {model: hr.sign.in.out.ask, id: hr_sign_in_out_ask_markjohnson0}: last_time: !eval time.strftime('%Y-%m-%d %H:%M:%S') - name: Mark Johnson -- | - Now I click on "Sign In" button of this wizard. -- + name: Mark Johnson +- + Now I click on "Sign In" button of this wizard. +- !python {model: hr.sign.in.out.ask}: | obj_attendance = self.pool.get('hr.employee') emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Mark Johnson")]) @@ -106,4 +106,11 @@ employee = obj_attendance.read(cr, uid, emp_id)[0] self.write(cr, uid, [ref('hr_sign_in_out_ask_markjohnson0')], {'emp_id': emp_id[0]}) #self.sign_in(cr, uid, [ref("hr_sign_in_out_ask_markjohnson0")], {"active_ids": [ref("hr_attendance.menu_hr_attendance_sigh_in_out")]}) - \ No newline at end of file + +- + Finally i will check the state of the employee is present. +- + !record {model: hr.sign.in.out, id: hr_sign_in_out_markjohnson0}: + name: Mark Johnson + state: present + diff --git a/addons/hr_contract/test/test_hr_contract.yml b/addons/hr_contract/test/test_hr_contract.yml index cbcc7e67fda..084e45620a4 100644 --- a/addons/hr_contract/test/test_hr_contract.yml +++ b/addons/hr_contract/test/test_hr_contract.yml @@ -1,9 +1,8 @@ -- | - In order to test hr_contract module in OpenERP, - I will create contract for "Mark Johnson" employee. - -- | - I create Employee "Mark Johnson" to assign contract. +- + In order to test hr_contract module in OpenERP, I will create a new employee and create contract for the same. + +- + I create a new employee "Mark Johnson". - !record {model: hr.employee, id: hr_employee_employee0}: address_home_id: base.res_partner_address_1 @@ -11,29 +10,31 @@ gender: male name: Mark Johnson user_id: base.user_root - -- | - Given that I have Contract wage period "monthly" and - specify "hours in period" is "176.00" -- + children: 2 + marital: hr.hr_employee_marital_status_married + place_of_birth: Belgium + vehicle: 'No' + vehicle_distance: 12 + + +- + I create a new Contract wage period. +- !record {model: hr.contract.wage.type.period, id: hr_contract_wage_type_period_monthly0}: - factor_days: 178.0 + factor_days: 176.0 name: monthly -- | - Given that I have Contract wage type "Monthly Gross Wage". - select wage period "monthly" and type "Gross". with hour cost "1.9" -- +- + I create a new Contract Wage Type. +- !record {model: hr.contract.wage.type, id: hr_contract_wage_type_monthlygrosswage0}: factor_type: 1.9 name: Monthly Gross Wage period_id: 'hr_contract_wage_type_period_monthly0' type: gross - -- | - Now I start by creating contract for "Mark Johnson". - Select wage type "Monthly Gross Wage" and Wage period "monthly" - which I had given. -- + +- + I create a new contract for "Mark Johnson". +- !record {model: hr.contract, id: hr_contract_contract0}: advantages_gross: 0.0 employee_id: 'hr_employee_employee0' diff --git a/addons/hr_holidays/test/test_hr_holiday.yml b/addons/hr_holidays/test/test_hr_holiday.yml index 68d58b1791b..03c1666dc6f 100644 --- a/addons/hr_holidays/test/test_hr_holiday.yml +++ b/addons/hr_holidays/test/test_hr_holiday.yml @@ -1,8 +1,8 @@ -- | - In order to test the hr_holiday in OpenERP, I will Allocate leaves for Employee and manage leaves and leaves requests. -- | - For that First I create new user "user1" to make leave request. -- +- + In order to test the hr_holiday module in OpenERP, I will Allocate leaves for Employee and manage leaves and leaves requests. +- + I create new user "user1" to who makes leave request. +- !record {model: res.users, id: res_users_user0}: company_id: base.main_company context_lang: en_US @@ -13,7 +13,7 @@ login: user1 name: user1 password: user1 -- | +- I create a new employee “Mark Johnshon” as Manager to validate employee leave. - !record {model: hr.employee, id: hr_employee_employee0}: @@ -22,90 +22,87 @@ gender: male name: Mark Johnson user_id: base.user_root -- | - Create another employee "Phil Graves" as "user1" who make leave request. -- +- + I Create another employee "Phil Graves" as "user1". +- !record {model: hr.employee, id: hr_employee_philgraves0}: address_home_id: base.res_partner_address_8 name: Phil Graves parent_id: 'hr_employee_employee0' user_id: 'res_users_user0' -- | - Given that I have Leave type for employee. -- - !record {model: hr.holidays.status, id: hr_holidays_status_fullleave0}: +- + I create a new Leave type "Sick Leave". +- + !record {model: hr.holidays.status, id: hr_holidays_status_sick0}: color_name: red - name: Full Leave. - limit: 1 + name: Sick Leave. + limit: 12 -- | - After that I allocate leave request for employee "Phil Graves". -- +- + I allocate leave request for employee "Phil Graves". +- !record {model: hr.holidays, id: hr_holidays_allocateleaveforuser0}: allocation_type: employee employee_id: 'hr_employee_philgraves0' - holiday_status_id: hr_holidays_status_fullleave0 - name: Allocate leave for user1 + holiday_status_id: hr_holidays_status_sick0 + name: Sick Leaves for Phil Graves number_of_days_temp: 12.0 date_from: '05/20/2010 13:59:00' date_to: '05/22/2010 13:59:00' type: add -- | - I click on "Confirm" button to confirm allocate leave for employee. -- - !workflow {model: hr.holidays, action: confirm, ref: hr_holidays_allocateleaveforuser0} - -- | - I click on "Validate" button to validate leave for employee. - - !workflow {model: hr.holidays, action: validate, ref: hr_holidays_allocateleaveforuser0} + I confirmed the allocation by clicking on "Confirm" button. +- + !workflow {model: hr.holidays, action: confirm, ref: hr_holidays_allocateleaveforuser0} -- | - Now employee "Phil Graves" want to leave. so, I connect as user1 which is username of this employee and want to make leave request. -- +- + I validate the allocation by clicking on "To Approve" button. +- + !workflow {model: hr.holidays, action: validate, ref: hr_holidays_allocateleaveforuser0} + +- + I connect as "user1", and create a new leave request for employee "Phil Graves". +- !record {model: hr.holidays, id: hr_holidays_iwanttoleaveforgotohospital0}: allocation_type: employee date_from: '2010-05-20 11:48:00' date_to: '2010-05-21 11:48:00' employee_id: 'hr_employee_philgraves0' - holiday_status_id: 'hr_holidays_status_fullleave0' - name: I want to leave for go to hospital - notes: I want to leave for go to hospital. so please accept my leave. + holiday_status_id: 'hr_holidays_status_sick0' + name: Appointment with Doctor + notes: My appointment with the doctor is confirmed. so please accept my leave. number_of_days_temp: 2.0 type: remove user_id: 'res_users_user0' -- | - I check that Leave Request is on "Draft" state. +- + I check that Leave Request is in "Draft" state. - !assert {model: hr.holidays, id: hr_holidays_iwanttoleaveforgotohospital0}: - - state == 'draft' - -- | - I confirm my leave Request by click on "Confirm" button. -- + - state == 'draft' + +- + I confirm leave Request by click on "Confirm" button. +- !workflow {model: hr.holidays, action: confirm, ref: hr_holidays_iwanttoleaveforgotohospital0} - -- | - I connect as Admin user and Open Leave request of "Phil Graves". - and "validate" it by click on "validate" button. -- + +- + I connect as "Admin" user and Open Leave request of "Phil Graves" and "validate" it by click on "Approve" button. +- !workflow {model: hr.holidays, action: validate, ref: hr_holidays_iwanttoleaveforgotohospital0} - -- | - I check that "Leave Manager" field is automaticly filled by the user who validate the leave'. + +- + I check that "Leave Manager" field is automatically filled by the user who validate the leave'. - !python {model: hr.holidays}: | ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)]) obj = self.browse(cr, uid, ref('hr_holidays_iwanttoleaveforgotohospital0')) assert ids2[0] == obj.manager_id.id - -- | + +- I check that Leave request state is "Validated". -- +- !assert {model: hr.holidays, id: hr_holidays_iwanttoleaveforgotohospital0}: - - state == "validate" - -- | - I can also see Summary of Employee's holiday by using 'Print Summary of Employee's Holidays'. - This will allow you to choose if you want to print either the Confirmed & Validated holidays or only the Validated ones. - \ No newline at end of file + - state == "validate" + +- + I can also see Summary of Employee's holiday by using 'Employee's Holidays' Report. This report will allows to choose to print holidays with state Confirmed, Validated or both. diff --git a/addons/hr_timesheet/test/test_hr_timesheet.yml b/addons/hr_timesheet/test/test_hr_timesheet.yml index 2b5a924805a..43143e4e324 100644 --- a/addons/hr_timesheet/test/test_hr_timesheet.yml +++ b/addons/hr_timesheet/test/test_hr_timesheet.yml @@ -1,9 +1,9 @@ -- | - In order to test hr_timesheet Module in OpenERP, I make "Sign In or Sign Out for Project" to encode and - track time spent on the different projects. +- + In order to test hr_timesheet Module in OpenERP, I make "Sign In/Sign Out for Project" to encode and + track time spent on the different projects. -- | - Now, I create a new employee “Mark Johnson” to test Timesheet. +- + I create a new employee “Mark Johnson” to test Timesheet. - !record {model: hr.employee, id: hr_employee_employee0}: address_home_id: base.res_partner_address_1 @@ -13,8 +13,8 @@ name: Mark Johnson user_id: base.user_root -- | - I create new user "user1" which is assigned to employee. +- + I create new user "user1". - !record {model: res.users, id: res_users_user0}: company_id: base.main_company @@ -29,8 +29,8 @@ name: user1 password: user1 -- | - I create another employee "Francline" as "user1". +- + I create another new employee "Francline" as "user1". - !record {model: hr.employee, id: hr_employee_fracline1}: address_home_id: base.res_partner_address_8 @@ -38,16 +38,16 @@ parent_id: 'hr_employee_employee0' user_id: 'res_users_user0' -- | - Given that I have Timesheet journal for employee. +- + I create Timesheet journal for employee. - !record {model: account.analytic.journal, id: analytic_journal}: code: TS name: Timesheet Journal type: general -- | - Given that I have product for "Consultancy - Senior Developer". +- + I create a product as "Consultancy - Senior Developer". - !record {model: product.product, id: product_consultant}: categ_id: product.product_category_10 @@ -62,42 +62,41 @@ uom_id: product.uom_hour uom_po_id: product.uom_hour -- | - I assing product and journal to "Mark Johnson" +- + I assigned product and journal to "Mark Johnson" - !record {model: hr.employee, id: hr_employee_employee0}: product_id: product_consultant journal_id: analytic_journal -- | - And also assing product and journal to "francline" employee. +- + I assigned product and journal to "Francline". - !record {model: hr.employee, id: hr_employee_fracline1}: product_id: product_consultant journal_id: analytic_journal -- | - Now , When I came in office , I create Attendances and perform "Sign In" action with proper reason. +- + I create attendance and perform "Sign In" action with proper reason. - !record {model: hr.attendance, id: hr_attendance_0}: action: sign_in employee_id: 'hr_employee_fracline1' name: '2010-05-26 10:08:08' -- | - When I left office , I create attendance and perform "Sign Out". +- + I create attendance and perform "Sign Out" action. - !record {model: hr.attendance, id: hr_attendance_1}: action: sign_out employee_id: 'hr_employee_fracline1' name: '2010-05-26 15:10:55' - -- | - I start by "Sign In/Sign Out by Project" wizard and click on "Sign In/Sign Out" button of this wizard. +- + On "Sign In/Sign Out by Project" wizard i click on "Sign In/Sign Out" button of this wizard. - !python {model: hr.sign.in.project}: | uid = ref('res_users_user0') self.check_state(cr, uid, [ref("hr_employee_fracline1")], {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]}) -- | +- I select start date and Perform start work on project. - !python {model: hr.sign.in.project}: | @@ -105,8 +104,8 @@ new_id = self.create(cr, uid, {'emp_id': 'hr_employee_fracline1', 'name': 'Francline', 'server_date': '2010-06-08 19:50:54', 'state': 'absent'}) self.sign_in_result(cr, uid, [new_id], context) -- | - My work is done and I want to stop work.for that I click on "Sign In/Sign Out" button of "Sign In/Sign Out by Project" wizard. +- + 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. - !python {model: hr.sign.in.project}: | @@ -115,11 +114,9 @@ self.check_state(cr, uid, ids, {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")] }) -- | - This will Open "hr sign out project" form. I select analytical project2 development account. -- - For that I Creating a analytic account. -- +- + I Create an analytic account "Project2". +- !record {model: account.analytic.account, id: account_analytic_account_project0}: company_id: base.main_company name: Project2 @@ -127,8 +124,8 @@ quantity_max: 0.0 state: open -- | - My work for this project is over and I stop work by click on "Stop Work" button of this wizard. +- + My work for this project is over and I stop working by clicking on "Stop Work" button of this wizard. - !python {model: hr.sign.out.project}: | import time 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 38186031028..c21a5b36ebb 100644 --- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml +++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml @@ -1,55 +1,36 @@ -- | - In order, to test hr_timesheet_sheet module in OpenERP, I create timesheet and check validation process done by - manager. - -- | - Now, I create a new employee “Mark Johnson” to test Timesheet. +- + In order to test hr_timesheet_sheet module in OpenERP, I create timesheet and check validation process done by manager. +- + I will create a company and set maximum allowed difference between timesheet and attendance to 1 hour +- + !record {model: res.company, id: res_company_openERP}: + currency_id: base.ARS + name: OpenERP SA + partner_id: base.res_partner_desertic_hispafuentes + timesheet_max_difference: 1.0 + +- + I create a new employee “Mark Johnson”. - !record {model: hr.employee, id: hr_employee_employee0}: address_home_id: base.res_partner_address_1 - company_id: base.main_company + company_id: res_company_openERP gender: male marital: hr.hr_employee_marital_status_single name: Mark Johnson user_id: base.user_root - -- | - I create new user "user1". -- - !record {model: res.users, id: res_users_user0}: - company_id: base.main_company - context_lang: en_US - groups_id: - - hr.group_hr_user - - hr_attendance.group_hr_attendance - - base.group_user - - base.group_extended - - hr.group_hr_manager - login: user1 - name: user1 - password: user1 -- | - create another employee "Francline" as "user1". -- - !record {model: hr.employee, id: hr_employee_fracline0}: - address_home_id: base.res_partner_address_8 - name: Francline - parent_id: 'hr_employee_employee0' - user_id: 'res_users_user0' - -- | - Given that I have Timesheet journal for employee. - -- +- + I create new Timesheet journal for employee. +- !record {model: account.analytic.journal, id: analytic_journal}: code: TS name: Timesheet Journal type: general - -- | - Given that I have product for "Consultancy - Senior Developer". -- + +- + I create a new product "Consultancy - Senior Developer". +- !record {model: product.product, id: product_consultant}: categ_id: product.product_category_10 default_code: DEV @@ -63,77 +44,110 @@ uom_id: product.uom_hour uom_po_id: product.uom_hour -- | - I assing product and journal to "Mark Johnson" -- +- + I assign this product and journal to "Mark Johnson" +- !record {model: hr.employee, id: hr_employee_employee0}: - product_id: product_consultant + product_id: product_consultant journal_id: analytic_journal -- | - And also assing product and journal to "francline" employee. -- - !record {model: hr.employee, id: hr_employee_fracline0}: - product_id: product_consultant - journal_id: analytic_journal - -- | - I connect as "francline" and create my current timesheet. -- + +- + I create my current timesheet for "Mark Johnson". +- !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: date_current: '2010-05-26' date_from: '2010-05-01' date_to: '2010-05-31' name: Week-22(2010) state: new - user_id: 'res_users_user0' -- | - Now , When I came in office , I create Attendances and perform "Sign In" action with proper reason. -- + user_id: base.user_root +- + Now , at the time of login, I create Attendances and perform "Sign In" action. +- !record {model: hr.attendance, id: hr_attendance_0}: action: sign_in - employee_id: 'hr_employee_fracline0' + employee_id: 'hr_employee_employee0' name: '2010-05-26 10:08:08' - -- | - When I left office , I create attendance and perform "Sign Out". -- + +- + At the time of logout, I create attendance and perform "Sign Out". +- !record {model: hr.attendance, id: hr_attendance_1}: action: sign_out - employee_id: 'hr_employee_fracline0' + employee_id: 'hr_employee_employee0' name: '2010-05-26 15:10:55' -- - I create Timesheet Entry for time spend on today work. - - + I create Timesheet Entry for time spend on today work. + +- !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet.sheet1}: timesheet_ids: - account_id: account.analytic_sednacom date: '05/26/2010' name: 'Develop yaml for hr module' - unit_amount: 5.00 + unit_amount: 3.00 amount: -90.00 product_id: hr_timesheet.product_consultant general_account_id: account.a_expense - user_id: res_users_user0 - journal_id: hr_timesheet.analytic_journal - -- | - I confirm my timesheet at end of period by click on "Confirm" button which is signal of workflow. -- - !python {model: hr_timesheet_sheet.sheet}: | - uid = ref('res_users_user0') - self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')]) -- | - I check that state is "Confirmed". -- - !assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: - - state == 'confirm' -- | - "Mark Johnson" check timesheet and time spend on project by "francline" employee. - And then accept it request by click on "Accept" button.If "Maximal difference between timesheet and attendances" is more than 1 then manage can "Refuse" his request. - + user_id: base.user_root + journal_id: hr_timesheet.analytic_journal - - !python {model: hr_timesheet_sheet.sheet}: | - self.write(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {'state': 'done'}) \ No newline at end of file + I confirm my timesheet at end of period by click on "Confirm" button, + if the difference between timesheet hour and attendance hour is more than 1 hour it will give message. +- + !python {model: hr_timesheet_sheet.sheet}: | + uid = ref('base.user_root') + for sheet in self.browse(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')]): + di = sheet.user_id.company_id.timesheet_max_difference + if (abs(sheet.total_difference) < di) or not di: + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr) + else: + print "Please verify that the total difference of the sheet is lower than %.2f" %di + +- + I Modified the timesheet record. +- + !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet.sheet1}: + timesheet_ids: + - account_id: account.analytic_sednacom + date: '05/26/2010' + name: 'Develop yaml for hr module' + unit_amount: 2.0 + amount: -90.00 + product_id: hr_timesheet.product_consultant + general_account_id: account.a_expense + user_id: base.user_root + journal_id: hr_timesheet.analytic_journal + +- + I tried again to confirm the timesheet after modification. +- + !python {model: hr_timesheet_sheet.sheet}: | + uid = ref('base.user_root') + self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {"lang": 'en_US', "active_ids": + [ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form")], "tz": False, "active_model": + "ir.ui.menu", "department_id": False, "section_id": False, "search_default_my_timesheet": + 1, "search_default_user_id": 1, "project_id": False, "active_id": ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"), + }) + +- + This time timesheet confirmed successfully. + I check that state is "Confirmed". +- + !assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: + - state == 'confirm' +- + The manager will accept This request by click on "Accept" button. + +- + !python {model: hr_timesheet_sheet.sheet}: | + self.write(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {'state': 'done'}) +- + I check that state is "Done". +- + !assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: + - state == 'done' +