2 Create a user 'HR Manager'
4 !record {model: res.users, id: res_users_hrmanager0, view: False}:
5 company_id: base.main_company
10 - base.group_hr_manager
12 Create a product with type service used to specify employees designation
14 !record {model: product.product, id: product_product_hrmanger0}:
15 categ_id: product.product_category_6
19 procure_method: make_to_stock
23 uom_id: product.product_uom_hour
24 uom_po_id: product.product_uom_hour
30 Create an analytic journal for employees timesheet
32 !record {model: account.analytic.journal, id: account_analytic_journal_hrtimesheet0}:
33 company_id: base.main_company
37 Create an employee 'HR Manager' for user 'HR Manager'
39 !record {model: hr.employee, id: hr_employee_hrmanager0}:
41 user_id: res_users_hrmanager0
42 product_id: product_product_hrmanger0
43 journal_id: account_analytic_journal_hrtimesheet0
45 Create a timesheet sheet for HR manager
47 !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0}:
48 date_from: !eval "'%s-05-01' %(datetime.now().year)"
49 date_to: !eval "'%s-05-31' %(datetime.now().year)"
50 name: Sheet for hr manager
52 user_id: res_users_hrmanager0
53 employee_id : 'hr_employee_hrmanager0'
55 Create a project 'Timesheet Management'
57 !record {model: project.project, id: project_project_timesheetmanagement0}:
58 company_id: base.main_company
59 name: Timesheet Management
61 Create a task 'Get all timesheet records'
63 !record {model: project.task, id: project_task_getalltimesheetrecords0}:
64 date_start: !eval time.strftime('%Y-05-%d %H:%M:%S')
65 name: Get all timesheet records
67 project_id: project_project_timesheetmanagement0
69 user_id: res_users_hrmanager0
71 Make a work task entry 'Get work calendar of all employees' of 10 hours done by HR manager
73 !record {model: project.task, id: project_task_getalltimesheetrecords0}:
75 - date: !eval time.strftime('%Y-05-%d %H:%M:%S')
77 name: Get work calendar of all employees
78 user_id: res_users_hrmanager0
80 Check for timesheet_ids in HR manager's timesheet
82 !assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0, string: After hr manager's work task, length of timesheet line of current timesheet must be greater then 1}:
83 - len(timesheet_ids) > 0