924977420582c48a0d4a84fb2a5d1b859bfa6aaf
[odoo/odoo.git] / addons / hr_holidays / test / test_hr_holiday.yml
1 -
2   In order to test the hr_holiday module in OpenERP, I will  Allocate leaves for Employee and manage leaves and leaves requests.
3 -
4   I assign the dates in the holiday request.
5 -
6   !record {model: hr.holidays, id: hr_holiday1}:
7     name: Sick Leave
8     holiday_status_id: holiday_status_cl
9     date_from: !eval time.strftime('%Y-%m-10')
10     date_to: !eval time.strftime('%Y-%m-11')
11     employee_id: hr.employee_fp
12     type: remove
13 -
14   I confirmed the holiday request by clicking on "Confirm" button.
15 -
16   !workflow {model: hr.holidays, action: confirm, ref: hr_holidays_employee1_cl}
17 -
18   I find a small mistake on my leave request to I click on "Refuse" button to correct a mistake.
19 -
20   !workflow {model: hr.holidays, action: refuse, ref: hr_holidays_employee1_cl}
21 -
22   I again set to draft and then confirm.
23 -
24   !python {model: hr.holidays}: |
25      import netsvc
26      wf_service = netsvc.LocalService("workflow")
27      self.set_to_draft(cr, uid, [ref('hr_holidays_employee1_cl')])
28      wf_service.trg_validate(uid, 'hr.holidays', ref('hr_holidays_employee1_cl'), 'confirm', cr)
29 -
30   I validate the holiday request by clicking on "To Approve" button.
31 -
32   !workflow {model: hr.holidays, action: validate,  ref: hr_holidays_employee1_cl}
33 -
34   I can also see Summary of Employee's holiday by using "Employee's Holidays" Report. This report will allows to choose to print holidays with state Confirmed, Validated or both.