2 I test the 'Payment Advice' in order to check the hr_payroll in OpenERP
6 !record {model: res.partner.bank, id: res_partner_bank_0}:
7 acc_number: '987654321'
8 partner_id: base.res_partner_desertic_hispafuentes
14 I create a new employee “Richard”
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'
22 - advantages_gross: 0.0
24 date_end: '2011-07-01'
25 date_start: '2010-07-01'
28 wage_type_id: hr_contract.hr_contract_monthly_gross
29 type_id: hr_contract.hr_contract_type_emp
31 department_id: hr.dep_it
32 employee_account: account.a_recv
34 marital: hr.hr_employee_marital_status_single
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
42 I create a new payroll structure for software developer
44 !record {model: hr.payroll.structure, id: hr_payroll_structure_softwaredeveloper0}:
47 - account_id: account.a_expense
48 amount: 0.40000000000000002
50 category_id: hr_payroll.HRA
53 name: House Rant Allowance
57 - account_id: account.a_expense
60 category_id: hr_payroll.CA
63 name: Convance Allowance
67 - account_id: account.a_pay
70 category_id: hr_payroll.PT
73 name: Professional Tax
77 - account_id: account.a_pay
80 category_id: hr_payroll.PF
87 name: Software Developer
89 I create a employee payslip record
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
96 I click on 'Compute Sheet' button
98 !workflow {model: hr.payslip, action: compute_sheet, ref: hr_payslip_0}
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"),
108 I check that the order is now in "Waiting for Verification" state
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!')
115 I click on Verify Sheet button.
117 !workflow {model: hr.payslip, action: verify_sheet, ref: hr_payslip_0}
119 I check that the order is in the "Waiting for HR Verification" state
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!')
126 I click on Complete HR Checking button.
128 !workflow {model: hr.payslip, action: final_verify_sheet, ref: hr_payslip_0}
130 I check that the order is in "Confirm Sheet" state.
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!')
137 I click on Pay Salary button
139 !workflow {model: hr.payslip, action: process_sheet, ref: hr_payslip_0}
141 I check that the order is in "Paid Salary" state.
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!')