2010-07-06 09:07:09 +00:00
|
|
|
-
|
2011-06-07 08:36:11 +00:00
|
|
|
I test "Payslip" in order to check the hr_payroll module in OpenERP
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
2011-06-07 08:36:11 +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}:
|
|
|
|
birthday: '1984-05-01'
|
2011-06-07 08:36:11 +00:00
|
|
|
country_id: base.be
|
2011-12-22 14:22:57 +00:00
|
|
|
department_id: hr.dep_rd
|
2010-07-06 09:07:09 +00:00
|
|
|
gender: male
|
|
|
|
name: Richard
|
|
|
|
-
|
2011-06-07 08:36:11 +00:00
|
|
|
I create a salary structure for "Software Developer"
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
2011-06-06 13:01:57 +00:00
|
|
|
!record {model: hr.payroll.structure, id: hr_payroll_structure_softwaredeveloper}:
|
|
|
|
name: Salary Structure for Software Developer
|
2010-07-06 09:07:09 +00:00
|
|
|
code: SD
|
2011-06-06 13:01:57 +00:00
|
|
|
company_id: base.main_company
|
2011-06-07 08:36:11 +00:00
|
|
|
rule_ids:
|
2011-07-11 10:27:54 +00:00
|
|
|
- hr_salary_rule_houserentallowance1
|
|
|
|
- hr_salary_rule_convanceallowance1
|
|
|
|
- hr_salary_rule_professionaltax1
|
|
|
|
- hr_salary_rule_providentfund1
|
2011-06-06 13:01:57 +00:00
|
|
|
- hr_salary_rule_meal_voucher
|
|
|
|
- hr_salary_rule_sales_commission
|
|
|
|
-
|
2011-06-07 08:36:11 +00:00
|
|
|
I create a contract for "Richard"
|
2011-06-06 13:01:57 +00:00
|
|
|
-
|
|
|
|
!record {model: hr.contract, id: hr_contract_richard}:
|
2012-02-29 08:42:40 +00:00
|
|
|
date_end: !eval "(datetime.now() + timedelta(days=365)).strftime('%Y-%m-%d')"
|
2011-06-06 13:01:57 +00:00
|
|
|
date_start: !eval time.strftime('%Y-%m-%d')
|
|
|
|
name: Contract for Richard
|
|
|
|
wage: 5000.0
|
|
|
|
type_id: hr_contract.hr_contract_type_emp
|
|
|
|
employee_id: hr_employee_richard0
|
|
|
|
struct_id: hr_payroll_structure_softwaredeveloper
|
|
|
|
working_hours: resource.timesheet_group1
|
|
|
|
-
|
2011-06-07 08:36:11 +00:00
|
|
|
I create a Employee Payslip
|
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
|
2011-06-06 13:01:57 +00:00
|
|
|
-
|
|
|
|
I assign the amount to Input data
|
|
|
|
-
|
|
|
|
!python {model: hr.payslip.input}: |
|
|
|
|
ids = self.search(cr, uid, [('payslip_id', '=', ref("hr_payslip_0"))])
|
|
|
|
self.write(cr, uid, ids, {'amount': 5.0})
|
2011-06-07 08:36:11 +00:00
|
|
|
-
|
2011-06-06 13:01:57 +00:00
|
|
|
I verify the payslip is in draft state
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.payslip}: |
|
|
|
|
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
|
2011-11-14 22:42:13 +00:00
|
|
|
assert (payslip_brw.state == 'draft'), 'State not changed!'
|
2010-07-30 08:59:35 +00:00
|
|
|
-
|
2011-06-07 08:36:11 +00:00
|
|
|
I click on 'Compute Sheet' button on payslip
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.payslip}: |
|
2011-06-06 13:01:57 +00:00
|
|
|
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
|
|
|
-
|
2011-06-07 08:36:11 +00:00
|
|
|
Then I click on the 'Confirm' button on payslip
|
|
|
|
-
|
2011-06-06 13:01:57 +00:00
|
|
|
!workflow {model: hr.payslip, action: hr_verify_sheet, ref: hr_payslip_0}
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
2011-06-06 13:01:57 +00:00
|
|
|
I verify that the payslip is in done state
|
2010-07-06 09:07:09 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.payslip}: |
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools.translate import _
|
2010-07-06 09:07:09 +00:00
|
|
|
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
|
2011-09-22 12:30:00 +00:00
|
|
|
assert(payslip_brw.state == 'done'), _('State not changed!')
|
|
|
|
-
|
|
|
|
I want to check refund payslip so I click on refund button.
|
|
|
|
-
|
|
|
|
!python {model: hr.payslip}: |
|
|
|
|
self.refund_sheet(cr, uid, [ref("hr_payslip_0")], None)
|
|
|
|
-
|
|
|
|
I check on new payslip Credit Note is checked or not.
|
|
|
|
-
|
|
|
|
!python {model: hr.payslip}: |
|
|
|
|
payslip_obj = self.browse(cr, uid, ref("hr_payslip_0"), None)
|
|
|
|
payslip_ids = self.search(cr, uid, [('name','like','Refund: '+payslip_obj.name),('credit_note','=',True)], None)
|
|
|
|
assert payslip_ids, "Payslip not refunded!"
|
|
|
|
-
|
|
|
|
I want to generate a payslip from Payslip run.
|
|
|
|
-
|
|
|
|
!record {model: hr.payslip.run, id: hr_payslip_run_PayslipforEmployee0}:
|
|
|
|
date_end: '2011-09-30'
|
|
|
|
date_start: '2011-09-01'
|
|
|
|
name: Payslip for Employee
|
|
|
|
-
|
|
|
|
I create record for generating the payslip for this Payslip run.
|
|
|
|
-
|
|
|
|
!record {model: hr.payslip.employees, id: hr_payslip_employees0}:
|
|
|
|
employee_ids:
|
|
|
|
- hr_employee_richard0
|
|
|
|
-
|
|
|
|
I generate the payslip by clicking on Generat button wizard.
|
|
|
|
-
|
|
|
|
!python {model: hr.payslip.employees}: |
|
|
|
|
self.compute_sheet(cr, uid, [ref('hr_payslip_employees0')], context={'active_id': ref('hr_payslip_run_PayslipforEmployee0')})
|
|
|
|
-
|
|
|
|
I open Contribution Register and from there I print the Payslip Lines report.
|
|
|
|
-
|
|
|
|
!record {model: payslip.lines.contribution.register, id: payslip_lines_contribution_register0}:
|
|
|
|
date_from: '2011-09-30'
|
|
|
|
date_to: '2011-09-01'
|
|
|
|
-
|
|
|
|
I print the report.
|
|
|
|
-
|
|
|
|
!python {model: payslip.lines.contribution.register}: |
|
|
|
|
self.print_report(cr, uid, [ref('payslip_lines_contribution_register0')], context={'active_ids': [ref('hr_houserent_register')]})
|
|
|
|
|