2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
I test the 'Payment Advice' in order to check the hr_payroll in OpenERP
|
2010-07-30 08:59:35 +00:00
|
|
|
-
|
|
|
|
I Create a bank record
|
|
|
|
-
|
|
|
|
!record {model: res.partner.bank, id: res_partner_bank_0}:
|
|
|
|
acc_number: '987654321'
|
|
|
|
partner_id: base.res_partner_desertic_hispafuentes
|
|
|
|
sequence: 0.0
|
2010-09-01 17:58:28 +00:00
|
|
|
name: Fortis
|
2010-07-30 08:59:35 +00:00
|
|
|
state: bank
|
2010-10-04 09:58:13 +00:00
|
|
|
bank: base.res_bank_1
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
I create a new employee “Richard”
|
2010-07-30 08:59:35 +00:00
|
|
|
-
|
2010-07-06 09:07:09 +00:00
|
|
|
!record {model: hr.employee, id: hr_employee_richard0}:
|
|
|
|
address_home_id: base.res_partner_address_2
|
|
|
|
address_id: base.res_partner_address_9
|
|
|
|
birthday: '1984-05-01'
|
|
|
|
children: 0.0
|
|
|
|
contract_ids:
|
|
|
|
- advantages_gross: 0.0
|
|
|
|
advantages_net: 0.0
|
2011-01-05 07:29:14 +00:00
|
|
|
date_end: !eval "'%s-%s-%s' %(datetime.now().year+1,datetime.now().month,datetime.now().day)"
|
|
|
|
date_start: !eval time.strftime('%Y-%m-%d')
|
2010-07-06 09:07:09 +00:00
|
|
|
name: reference
|
|
|
|
wage: 5000.0
|
|
|
|
wage_type_id: hr_contract.hr_contract_monthly_gross
|
2010-09-15 05:32:58 +00:00
|
|
|
type_id: hr_contract.hr_contract_type_emp
|
2010-07-06 09:07:09 +00:00
|
|
|
country_id: base.in
|
|
|
|
department_id: hr.dep_it
|
|
|
|
gender: male
|
|
|
|
marital: hr.hr_employee_marital_status_single
|
|
|
|
name: Richard
|
2010-07-30 08:59:35 +00:00
|
|
|
bank_account_id: res_partner_bank_0
|
2010-07-06 09:07:09 +00:00
|
|
|
vehicle_distance: 0.0
|
|
|
|
-
|
2010-07-30 08:59:35 +00:00
|
|
|
I create a new payroll structure for software developer
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!record {model: hr.payroll.structure, id: hr_payroll_structure_softwaredeveloper0}:
|
|
|
|
code: SD
|
|
|
|
line_ids:
|
2010-12-21 11:25:30 +00:00
|
|
|
- amount: 0.40000000000000002
|
2010-07-06 09:07:09 +00:00
|
|
|
amount_type: per
|
|
|
|
category_id: hr_payroll.HRA
|
|
|
|
code: HRA
|
|
|
|
company_contrib: 0.0
|
|
|
|
name: House Rant Allowance
|
|
|
|
sequence: 5
|
|
|
|
total: 0.0
|
|
|
|
type: allowance
|
2010-12-21 11:25:30 +00:00
|
|
|
- amount: 10000.0
|
2010-07-06 09:07:09 +00:00
|
|
|
amount_type: fix
|
|
|
|
category_id: hr_payroll.CA
|
|
|
|
code: CA
|
|
|
|
company_contrib: 0.0
|
|
|
|
name: Convance Allowance
|
|
|
|
sequence: 10
|
|
|
|
total: 0.0
|
|
|
|
type: allowance
|
2010-12-21 11:25:30 +00:00
|
|
|
- amount: 10000.0
|
2010-07-06 09:07:09 +00:00
|
|
|
amount_type: fix
|
|
|
|
category_id: hr_payroll.PT
|
|
|
|
code: PT
|
|
|
|
company_contrib: 0.0
|
|
|
|
name: Professional Tax
|
|
|
|
sequence: 15
|
|
|
|
total: 0.0
|
|
|
|
type: deduction
|
2010-12-21 11:25:30 +00:00
|
|
|
- amount: 0.125
|
2010-07-06 09:07:09 +00:00
|
|
|
amount_type: per
|
|
|
|
category_id: hr_payroll.PF
|
|
|
|
code: PF
|
|
|
|
company_contrib: 0.0
|
|
|
|
name: Provident Fund
|
|
|
|
sequence: 20
|
|
|
|
total: 0.0
|
|
|
|
type: deduction
|
|
|
|
name: Software Developer
|
|
|
|
-
|
|
|
|
I create a employee payslip record
|
2010-07-30 08:59:35 +00:00
|
|
|
-
|
2010-07-06 09:07:09 +00:00
|
|
|
!record {model: hr.payslip, id: hr_payslip_0}:
|
|
|
|
employee_id: hr_payroll.hr_employee_richard0
|
2010-12-21 11:25:30 +00:00
|
|
|
|
2010-07-30 08:59:35 +00:00
|
|
|
-
|
2010-07-06 09:07:09 +00:00
|
|
|
I click on 'Compute Sheet' button
|
2010-07-30 08:59:35 +00:00
|
|
|
-
|
2010-07-06 09:07:09 +00:00
|
|
|
!workflow {model: hr.payslip, action: compute_sheet, ref: hr_payslip_0}
|
2010-07-30 08:59:35 +00:00
|
|
|
-
|
|
|
|
just to test
|
|
|
|
-
|
2010-07-06 09:07:09 +00:00
|
|
|
!python {model: hr.payslip}: |
|
|
|
|
self.compute_sheet(cr, uid, [ref("hr_payslip_0")], {"lang": "en_US", "tz": False,
|
|
|
|
"active_model": "ir.ui.menu", "department_id": False, "active_ids": [ref("hr_payroll.menu_department_tree")],
|
|
|
|
"section_id": False, "active_id": ref("hr_payroll.menu_department_tree"),
|
|
|
|
})
|
|
|
|
-
|
2010-07-30 08:59:35 +00:00
|
|
|
I check that the order is now in "Waiting for Verification" state
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.payslip}: |
|
|
|
|
from tools.translate import _
|
|
|
|
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
|
2010-07-30 08:59:35 +00:00
|
|
|
assert(payslip_brw.state == 'draft'), _('State not changed!')
|
|
|
|
-
|
|
|
|
I click on Verify Sheet button.
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!workflow {model: hr.payslip, action: verify_sheet, ref: hr_payslip_0}
|
|
|
|
-
|
2010-07-30 08:59:35 +00:00
|
|
|
I check that the order is in the "Waiting for HR Verification" state
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.payslip}: |
|
|
|
|
from tools.translate import _
|
|
|
|
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
|
2010-07-30 08:59:35 +00:00
|
|
|
assert(payslip_brw.state == 'hr_check'), _('State not changed!')
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
2010-07-30 08:59:35 +00:00
|
|
|
I click on Complete HR Checking button.
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!workflow {model: hr.payslip, action: final_verify_sheet, ref: hr_payslip_0}
|
|
|
|
-
|
2010-07-30 08:59:35 +00:00
|
|
|
I check that the order is in "Confirm Sheet" state.
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.payslip}: |
|
|
|
|
from tools.translate import _
|
|
|
|
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
|
2010-07-30 08:59:35 +00:00
|
|
|
assert(payslip_brw.state == 'confirm'), _('State not changed!')
|
|
|
|
-
|
|
|
|
I click on Pay Salary button
|
|
|
|
-
|
2010-07-06 09:07:09 +00:00
|
|
|
!workflow {model: hr.payslip, action: process_sheet, ref: hr_payslip_0}
|
|
|
|
-
|
2010-07-30 08:59:35 +00:00
|
|
|
I check that the order is in "Paid Salary" state.
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.payslip}: |
|
|
|
|
from tools.translate import _
|
|
|
|
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
|
2010-07-30 08:59:35 +00:00
|
|
|
assert(payslip_brw.state == 'done'), _('State not changed!')
|