2010-06-03 11:24:20 +00:00
-
Create an user 'HR Manager'
-
!record {model: res.users, id: res_users_hrmanager0}:
company_id : base.main_company
context_lang : en_US
login : hr
name : HR Manager
password : hr
-
Create a product with type service used to specifies employees designation
-
!record {model: product.product, id: product_product_hrmanger0}:
categ_id : product.product_category_services
cost_method : standard
mes_type : fixed
name : HR Manger
procure_method : make_to_stock
standard_price : 1.0
supply_method : buy
type : service
uom_id : product.product_uom_unit
uom_po_id : product.product_uom_unit
volume : 0.0
warranty : 0.0
weight : 0.0
weight_net : 0.0
-
Create an analytic journal for employees timesheet
-
!record {model: account.analytic.journal, id: account_analytic_journal_hrtimesheet0}:
company_id : base.main_company
name : HR Timesheet
type : general
-
Create an employee 'HR Manager' for user 'HR Manager'
-
!record {model: hr.employee, id: hr_employee_hrmanager0}:
name : HR Manager
user_id : res_users_hrmanager0
product_id : product_product_hrmanger0
journal_id : account_analytic_journal_hrtimesheet0
-
Create a timesheet sheet for hr manager
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0}:
date_current : '2010-06-03'
date_from : '2010-06-01'
date_to : '2010-06-30'
name : Sheet for hr manager
state : new
user_id : res_users_hrmanager0
-
Create a project 'Timesheet Management'
-
!record {model: project.project, id: project_project_timesheetmanagement0}:
company_id : base.main_company
name : Timesheet Management
-
Create a task 'Get all timesheet records'
-
!record {model: project.task, id: project_task_getalltimesheetrecords0}:
date_start : '2010-06-03 14:54:55'
name : Get all timesheet records
planned_hours : 20.0
project_id : project_project_timesheetmanagement0
remaining_hours : 20.0
state : draft
user_id : res_users_hrmanager0
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_getalltimesheetrecords0")], {"lang":
"en_US", "active_ids": [ ref("project_project_timesheetmanagement0")], "tz":
False , "active_model": "project.project", "department_id": False , "project_id" :
False , "active_id": ref("project_project_timesheetmanagement0"), })
-
Make a work task entry 'Get work calendar of all employees' of 10 hours done by hr manager
-
!record {model: project.task, id: project_task_getalltimesheetrecords0}:
work_ids :
- date : '2010-06-03 15:04:47'
hours : 10.0
name : Get work calendar of all employees
user_id : res_users_hrmanager0
-
Check for timesheet_ids in hr manager's timesheet
-
2010-06-04 12:29:04 +00:00
!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}:
2010-06-03 11:24:20 +00:00
- len(timesheet_ids) > 0