[FIX] base_iban,hr_payroll : 'bank' added in res.partner.bank record in demo data
[odoo/odoo.git] / addons / hr_payroll / test / payslip.yml
1 -
2   I test the 'Payment Advice' in order to check the hr_payroll in OpenERP
3 -
4   I Create a bank record
5 -
6   !record {model: res.partner.bank, id: res_partner_bank_0}:
7     acc_number: '987654321'
8     partner_id: base.res_partner_desertic_hispafuentes
9     sequence: 0.0
10     name: Fortis
11     state: bank
12     bank: base.res_bank_1
13 -
14   I create a new employee “Richard”
15 -
16   !record {model: hr.employee, id: hr_employee_richard0}:
17     address_home_id: base.res_partner_address_2
18     address_id: base.res_partner_address_9
19     birthday: '1984-05-01'
20     children: 0.0
21     contract_ids:
22       - advantages_gross: 0.0
23         advantages_net: 0.0
24         date_end: '2011-07-01'
25         date_start: '2010-07-01'
26         name: reference
27         wage: 5000.0
28         wage_type_id: hr_contract.hr_contract_monthly_gross
29         type_id: hr_contract.hr_contract_type_emp
30     country_id: base.in
31     department_id: hr.dep_it
32     employee_account: account.a_recv
33     gender: male
34     marital: hr.hr_employee_marital_status_single
35     name: Richard
36     pg_joining: '2009-12-01'
37     property_bank_account: account.cash
38     bank_account_id: res_partner_bank_0
39     salary_account: account.a_recv
40     vehicle_distance: 0.0
41 -
42   I create a new payroll structure for software developer
43 -
44   !record {model: hr.payroll.structure, id: hr_payroll_structure_softwaredeveloper0}:
45     code: SD
46     line_ids:
47       - account_id: account.a_expense
48         amount: 0.40000000000000002
49         amount_type: per
50         category_id: hr_payroll.HRA
51         code: HRA
52         company_contrib: 0.0
53         name: House Rant Allowance
54         sequence: 5
55         total: 0.0
56         type: allowance
57       - account_id: account.a_expense
58         amount: 10000.0
59         amount_type: fix
60         category_id: hr_payroll.CA
61         code: CA
62         company_contrib: 0.0
63         name: Convance Allowance
64         sequence: 10
65         total: 0.0
66         type: allowance
67       - account_id: account.a_pay
68         amount: 10000.0
69         amount_type: fix
70         category_id: hr_payroll.PT
71         code: PT
72         company_contrib: 0.0
73         name: Professional Tax
74         sequence: 15
75         total: 0.0
76         type: deduction
77       - account_id: account.a_pay
78         amount: 0.125
79         amount_type: per
80         category_id: hr_payroll.PF
81         code: PF
82         company_contrib: 0.0
83         name: Provident Fund
84         sequence: 20
85         total: 0.0
86         type: deduction
87     name: Software Developer
88 -
89   I create a employee payslip record
90 -
91   !record {model: hr.payslip, id: hr_payslip_0}:
92     bank_journal_id: account.bank_journal
93     employee_id: hr_payroll.hr_employee_richard0
94     journal_id: account.expenses_journal
95 -
96   I click on 'Compute Sheet' button
97 -
98   !workflow {model: hr.payslip, action: compute_sheet, ref: hr_payslip_0}
99 -
100   just to test
101 -
102   !python {model: hr.payslip}: |
103     self.compute_sheet(cr, uid, [ref("hr_payslip_0")], {"lang": "en_US", "tz": False,
104       "active_model": "ir.ui.menu", "department_id": False, "active_ids": [ref("hr_payroll.menu_department_tree")],
105       "section_id": False, "active_id": ref("hr_payroll.menu_department_tree"),
106       })
107 -
108   I check that the order is now in "Waiting for Verification" state
109 -
110   !python {model: hr.payslip}: |
111     from tools.translate import _
112     payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
113     assert(payslip_brw.state == 'draft'), _('State not changed!')
114 -
115   I click on Verify Sheet button.
116 -
117   !workflow {model: hr.payslip, action: verify_sheet, ref: hr_payslip_0}
118 -
119   I check that the order is in the "Waiting for HR Verification" state
120 -
121   !python {model: hr.payslip}: |
122     from tools.translate import _
123     payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
124     assert(payslip_brw.state == 'hr_check'), _('State not changed!')
125 -
126   I click on Complete HR Checking button.
127 -
128   !workflow {model: hr.payslip, action: final_verify_sheet, ref: hr_payslip_0}
129 -
130   I check that the order is in "Confirm Sheet" state.
131 -
132   !python {model: hr.payslip}: |
133     from tools.translate import _
134     payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
135     assert(payslip_brw.state == 'confirm'), _('State not changed!')
136 -
137   I click on Pay Salary button
138 -
139   !workflow {model: hr.payslip, action: process_sheet, ref: hr_payslip_0}
140 -
141   I check that the order is in "Paid Salary" state.
142 -
143   !python {model: hr.payslip}: |
144     from tools.translate import _
145     payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
146     assert(payslip_brw.state == 'done'), _('State not changed!')