[IMP] project_timesheet:YML improvements for dates

bzr revid: psi@tinyerp.co.in-20110105125700-3lg23srkdyyshnb3
This commit is contained in:
psi (Open ERP) 2011-01-05 18:27:00 +05:30
parent 40646c814c
commit 5a8ec7c3aa
1 changed files with 31 additions and 31 deletions

View File

@ -1,6 +1,6 @@
-
-
Create a user 'HR Manager'
-
-
!record {model: res.users, id: res_users_hrmanager0}:
company_id: base.main_company
context_lang: en_US
@ -8,11 +8,11 @@
name: HR Manager
password: hr
groups_id:
- base.group_hr_manager
-
- base.group_hr_manager
-
Create a product with type service used to specify employees designation
-
-
!record {model: product.product, id: product_product_hrmanger0}:
categ_id: product.product_category_services
cost_method: standard
@ -29,15 +29,15 @@
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}:
@ -45,60 +45,60 @@
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'
date_current: !eval time.strftime('%Y-%m-%d')
date_from: !eval "'%s-%s-01' %(datetime.now().year, datetime.now().month)"
date_to: !eval "'%s-%s-30' %(datetime.now().year, datetime.now().month)"
name: Sheet for hr manager
state: new
user_id: res_users_hrmanager0
employee_id : 'hr_employee_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'
date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S')
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
-
-
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'
- date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
hours: 10.0
name: Get work calendar of all employees
name: Get work calendar of all employees
user_id: res_users_hrmanager0
-
Check for timesheet_ids in HR manager's timesheet
-
!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}:
- len(timesheet_ids) > 0
- len(timesheet_ids) > 0