-
  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.
-
  I create employee "Quentin Paolino" as "User".
-
  !record {model: hr.employee, id: hr.employee_qdp}:
    address_home_id: base.res_partner_address_8
    name: Quentin Paolino
    parent_id: 'hr.employee_al'
    user_id: 'base.user_demo'
-
  On "Sign In/Sign Out by Project" wizard i click on "Sign In/Sign Out" button of this wizard.
-
  !python {model: hr.sign.in.project}: |
    uid = ref('base.user_demo')
    state_id = self.check_state(cr, uid, [ref("hr.employee_qdp")], {"active_ids": [ref("hr_timesheet.action_hr_timesheet_sign_in")]})
    assert state_id['name'] == 'Sign in / Sign out', "Check the process of sing-in/sing-out."
-
  I select start date and Perform start work on project.
-
  !python {model: hr.sign.in.project}: |
    import time
    uid = ref('base.user_demo')
    new_id = self.create(cr, uid, {'emp_id': ref('hr.employee_qdp'), 'name': 'Quentin Paolino',
    'server_date': time.strftime('%Y-%m-%d %H:%M:%S')})
    self.sign_in_result(cr, uid, [new_id], context)
-
  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')
    new_id = self.create(cr, uid, {'account_id': ref('account.analytic_nebula'),'analytic_amount': 7.0,
    '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',
    'name': 'Quentin Paolino', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'action'})
    self.sign_out_result(cr, uid, [new_id], context)
-
  My work for this project "Sednacom" is over and I stop working by clicking on "Stop Work" button of this wizard.
-
  !python {model: hr.sign.out.project}: |
    import time
    from datetime import datetime, date, timedelta
    uid = ref('base.user_demo')
    new_id = self.create(cr, uid, {'account_id': ref('account.analytic_spark'), 'analytic_amount': 7.0,
    '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',
    'name': 'Quentin Paolino', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'})
    self.sign_out_result_end(cr, uid, [new_id], context)
