2 Create a user 'HR Manager'
4 !record {model: res.users, id: res_users_hrmanager0}:
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
70 user_id: res_users_hrmanager0
74 !python {model: project.task}: |
75 self.do_open(cr, uid, [ref("project_task_getalltimesheetrecords0")], {"lang":
76 "en_US", "active_ids": [ref("project_project_timesheetmanagement0")], "tz":
77 False, "active_model": "project.project", "department_id": False, "project_id":
78 False, "active_id": ref("project_project_timesheetmanagement0"), })
80 Make a work task entry 'Get work calendar of all employees' of 10 hours done by HR manager
82 !record {model: project.task, id: project_task_getalltimesheetrecords0}:
84 - date: !eval time.strftime('%Y-05-%d %H:%M:%S')
86 name: Get work calendar of all employees
87 user_id: res_users_hrmanager0
89 Check for timesheet_ids in HR manager's timesheet
91 !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}:
92 - len(timesheet_ids) > 0