odoo/addons/hr_payroll/test/payroll_register.yml

65 lines
2.4 KiB
YAML

-
I test the 'Payroll Register' in order to check the hr_payroll in OpenERP
-
I create a new employee “Keith”
-
!record {model: hr.employee, id: hr_employee_keith0}:
address_home_id: base.res_partner_address_3
address_id: base.res_partner_address_9
birthday: '1984-05-01'
children: 0.0
contract_ids:
- advantages_gross: 0.0
advantages_net: 0.0
date_end: '2011-07-01'
date_start: '2010-07-01'
name: reference
wage: 5000.0
wage_type_id: hr_contract.hr_contract_monthly_gross
type_id: hr_contract.hr_contract_type_emp
country_id: base.in
department_id: hr.dep_it
employee_account: account.a_recv
gender: male
marital: hr.hr_employee_marital_status_single
name: Keith
pg_joining: '2009-12-01'
property_bank_account: account.cash
salary_account: account.a_recv
vehicle_distance: 0.0
-
I create a payroll register record.
-
!record {model: hr.payroll.register, id: hr_payroll_register_payroll0}:
bank_journal_id: account.bank_journal
date: '2010-07-02'
journal_id: account.expenses_journal
line_ids:
- employee_id: hr_payroll.hr_employee_keith0
bank_journal_id: account.bank_journal
journal_id: account.expenses_journal
name: payroll1
-
I click on Compute button.
-
!python {model: hr.payroll.register}: |
self.compute_sheet(cr, uid, [ref("hr_payroll_register_payroll0")], {"lang": "en_US",
"tz": False, "active_model": "ir.ui.menu", "department_id": False, "active_ids":
[ref("hr_payroll.hr_menu_payroll_register")], "section_id": False, "active_id":
ref("hr_payroll.hr_menu_payroll_register"), })
-
Then I click on Verify Sheet button.
-
!python {model: hr.payroll.register}: |
self.verify_sheet(cr, uid, [ref("hr_payroll_register_payroll0")], {"lang": "en_US",
"tz": False, "active_model": "ir.ui.menu", "department_id": False, "active_ids":
[ref("hr_payroll.hr_menu_payroll_register")], "section_id": False, "active_id":
ref("hr_payroll.hr_menu_payroll_register"), })
-
I check that a state has transferred from 'Wating for Verification' to 'Wating for HR Verification'state
-
!python {model: hr.payroll.register}: |
from tools.translate import _
reg_brw=self.browse(cr, uid, ref("hr_payroll_register_payroll0"))
assert(reg_brw.state == 'hr_check'), _('State not changed!')