2010-07-29 09:33:52 +00:00
|
|
|
-
|
|
|
|
In order to test hr_timesheet Module in OpenERP, I make "Sign In/Sign Out for Project" to encode and
|
|
|
|
track time spent on the different projects.
|
2013-03-14 11:20:18 +00:00
|
|
|
-
|
|
|
|
Give the access rights of Hr Officer to create employee.
|
|
|
|
-
|
|
|
|
!context
|
|
|
|
uid: 'res_hr_timesheet_officer'
|
2010-07-29 09:33:52 +00:00
|
|
|
-
|
2013-09-04 14:11:10 +00:00
|
|
|
I create employee "Gilles Gravie" as "User".
|
2010-05-31 08:17:27 +00:00
|
|
|
-
|
2011-12-22 13:35:59 +00:00
|
|
|
!record {model: hr.employee, id: hr.employee_qdp}:
|
2010-06-14 05:18:24 +00:00
|
|
|
address_home_id: base.res_partner_address_8
|
2013-09-04 14:11:10 +00:00
|
|
|
name: Gilles Gravie
|
2011-12-22 13:35:59 +00:00
|
|
|
parent_id: 'hr.employee_al'
|
2011-12-09 06:41:32 +00:00
|
|
|
user_id: 'base.user_demo'
|
2013-03-14 11:20:18 +00:00
|
|
|
-
|
|
|
|
Give the access rights of Employee to Sign In/Sign Out in Project.
|
|
|
|
-
|
|
|
|
!context
|
|
|
|
uid: 'res_hr_timesheet_employee'
|
2010-07-29 09:33:52 +00:00
|
|
|
-
|
|
|
|
On "Sign In/Sign Out by Project" wizard i click on "Sign In/Sign Out" button of this wizard.
|
2010-06-14 08:48:05 +00:00
|
|
|
-
|
2010-06-14 05:18:24 +00:00
|
|
|
!python {model: hr.sign.in.project}: |
|
2011-12-09 06:41:32 +00:00
|
|
|
uid = ref('base.user_demo')
|
2011-12-22 13:35:59 +00:00
|
|
|
state_id = self.check_state(cr, uid, [ref("hr.employee_qdp")], {"active_ids": [ref("hr_timesheet.action_hr_timesheet_sign_in")]})
|
2011-12-20 06:50:42 +00:00
|
|
|
assert state_id['name'] == 'Sign in / Sign out', "Check the process of sing-in/sing-out."
|
2010-07-29 09:33:52 +00:00
|
|
|
-
|
2010-06-14 08:48:05 +00:00
|
|
|
I select start date and Perform start work on project.
|
|
|
|
-
|
2010-06-14 05:18:24 +00:00
|
|
|
!python {model: hr.sign.in.project}: |
|
2011-12-20 06:50:42 +00:00
|
|
|
import time
|
|
|
|
uid = ref('base.user_demo')
|
2013-09-04 14:11:10 +00:00
|
|
|
new_id = self.create(cr, uid, {'emp_id': ref('hr.employee_qdp'), 'name': 'Gilles Gravie',
|
2012-10-19 11:54:25 +00:00
|
|
|
'server_date': time.strftime('%Y-%m-%d %H:%M:%S')})
|
2011-12-20 06:50:42 +00:00
|
|
|
self.sign_in_result(cr, uid, [new_id], context)
|
2010-06-14 08:48:05 +00:00
|
|
|
-
|
2011-12-20 06:50:42 +00:00
|
|
|
I change my project "Thymbra" and I click on the "Change Work" button of this wizard
|
|
|
|
-
|
|
|
|
!python {model: hr.sign.out.project}: |
|
|
|
|
import time
|
|
|
|
from datetime import datetime, date, timedelta
|
|
|
|
uid = ref('base.user_demo')
|
2012-06-20 12:03:05 +00:00
|
|
|
new_id = self.create(cr, uid, {'account_id': ref('account.analytic_nebula'),'analytic_amount': 7.0,
|
2011-12-20 06:50:42 +00:00
|
|
|
'date': (datetime.now()+timedelta(1)).strftime('%Y-%m-%d %H:%M:%S') ,
|
|
|
|
'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module',
|
2013-09-04 14:11:10 +00:00
|
|
|
'name': 'Gilles Gravie', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'present'})
|
|
|
|
|
2011-12-20 06:50:42 +00:00
|
|
|
self.sign_out_result(cr, uid, [new_id], context)
|
2010-07-29 09:33:52 +00:00
|
|
|
-
|
2011-12-20 06:50:42 +00:00
|
|
|
My work for this project "Sednacom" is over and I stop working by clicking on "Stop Work" button of this wizard.
|
2010-06-14 08:48:05 +00:00
|
|
|
-
|
2010-05-31 08:17:27 +00:00
|
|
|
!python {model: hr.sign.out.project}: |
|
2011-12-20 06:50:42 +00:00
|
|
|
import time
|
|
|
|
from datetime import datetime, date, timedelta
|
|
|
|
uid = ref('base.user_demo')
|
2012-06-20 12:03:05 +00:00
|
|
|
new_id = self.create(cr, uid, {'account_id': ref('account.analytic_spark'), 'analytic_amount': 7.0,
|
2011-12-20 06:50:42 +00:00
|
|
|
'date': (datetime.now()+timedelta(2)).strftime('%Y-%m-%d %H:%M:%S'),
|
|
|
|
'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module',
|
2013-09-04 14:11:10 +00:00
|
|
|
'name': 'Gilles Gravie', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'})
|
2011-12-21 10:52:14 +00:00
|
|
|
self.sign_out_result_end(cr, uid, [new_id], context)
|