2011-01-05 12:57:00 +00:00
-
2011-09-25 09:59:48 +00:00
Create a user 'HR Manager'
2011-01-05 12:57:00 +00:00
-
2010-06-03 11:24:20 +00:00
!record {model: res.users, id: res_users_hrmanager0}:
company_id : base.main_company
2012-08-10 10:22:57 +00:00
lang : en_US
2010-06-03 11:24:20 +00:00
login : hr
name : HR Manager
password : hr
2010-10-05 05:23:18 +00:00
groups_id :
2011-01-05 12:57:00 +00:00
- base.group_hr_manager
-
2011-09-25 09:59:48 +00:00
Create a product with type service used to specify employees designation
2011-01-05 12:57:00 +00:00
-
2010-06-03 11:24:20 +00:00
!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
2010-12-11 12:52:29 +00:00
uom_id : product.uom_hour
uom_po_id : product.uom_hour
2010-06-03 11:24:20 +00:00
volume : 0.0
warranty : 0.0
weight : 0.0
weight_net : 0.0
2011-01-05 12:57:00 +00:00
-
2011-09-25 09:59:48 +00:00
Create an analytic journal for employees timesheet
2011-01-05 12:57:00 +00:00
-
2010-06-03 11:24:20 +00:00
!record {model: account.analytic.journal, id: account_analytic_journal_hrtimesheet0}:
company_id : base.main_company
name : HR Timesheet
type : general
2011-01-05 12:57:00 +00:00
-
2011-09-25 09:59:48 +00:00
Create an employee 'HR Manager' for user 'HR Manager'
2010-06-03 11:24:20 +00:00
-
!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
2011-01-05 12:57:00 +00:00
-
2011-09-25 09:59:48 +00:00
Create a timesheet sheet for HR manager
2011-01-05 12:57:00 +00:00
-
2010-06-03 11:24:20 +00:00
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0}:
2011-08-31 09:07:24 +00:00
date_current : !eval time.strftime('%Y-05-%d')
date_from : !eval "'%s-05-01' %(datetime.now().year)"
date_to : !eval "'%s-05-31' %(datetime.now().year)"
2010-06-03 11:24:20 +00:00
name : Sheet for hr manager
state : new
user_id : res_users_hrmanager0
2010-10-08 13:38:25 +00:00
employee_id : 'hr_employee_hrmanager0'
2011-01-05 12:57:00 +00:00
-
2011-09-25 09:59:48 +00:00
Create a project 'Timesheet Management'
2011-01-05 12:57:00 +00:00
-
2010-06-03 11:24:20 +00:00
!record {model: project.project, id: project_project_timesheetmanagement0}:
company_id : base.main_company
name : Timesheet Management
2011-01-05 12:57:00 +00:00
-
2011-09-25 09:59:48 +00:00
Create a task 'Get all timesheet records'
2011-01-05 12:57:00 +00:00
-
2010-06-03 11:24:20 +00:00
!record {model: project.task, id: project_task_getalltimesheetrecords0}:
2011-08-31 09:07:24 +00:00
date_start : !eval time.strftime('%Y-05-%d %H:%M:%S')
2010-06-03 11:24:20 +00:00
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
2011-01-05 12:57:00 +00:00
-
2011-09-25 09:59:48 +00:00
Open the task
2011-01-05 12:57:00 +00:00
-
2010-06-03 11:24:20 +00:00
!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"), })
2011-01-05 12:57:00 +00:00
-
2011-09-25 09:59:48 +00:00
Make a work task entry 'Get work calendar of all employees' of 10 hours done by HR manager
2011-01-05 12:57:00 +00:00
-
2010-06-03 11:24:20 +00:00
!record {model: project.task, id: project_task_getalltimesheetrecords0}:
work_ids :
2011-08-31 09:07:24 +00:00
- date : !eval time.strftime('%Y-05-%d %H:%M:%S')
2010-06-03 11:24:20 +00:00
hours : 10.0
2011-01-05 12:57:00 +00:00
name : Get work calendar of all employees
2010-06-03 11:24:20 +00:00
user_id : res_users_hrmanager0
2011-08-26 13:18:39 +00:00
-
2011-09-25 09:59:48 +00:00
Check for timesheet_ids in HR manager's timesheet
2010-06-03 11:24:20 +00:00
-
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}:
2011-12-21 10:52:14 +00:00
- len(timesheet_ids) > 0