[IMP] hr_payroll_account: added yml for hr_payroll_account module
bzr revid: mtr@mtr-20110607051215-auc7uacqdo2he2we
This commit is contained in:
parent
0b52e63ee2
commit
d80ad7c068
|
@ -47,6 +47,9 @@ Generic Payroll system Integrated with Accountings.
|
||||||
'demo_xml': [
|
'demo_xml': [
|
||||||
'hr_payroll_account_demo.xml'
|
'hr_payroll_account_demo.xml'
|
||||||
],
|
],
|
||||||
|
'test': [
|
||||||
|
'test/hr_payroll_account.yml',
|
||||||
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'active': False,
|
'active': False,
|
||||||
'certificate' : '00923971112835220957',
|
'certificate' : '00923971112835220957',
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
-
|
||||||
|
I test the 'Payslip' in order to check the hr_payroll_account module in OpenERP
|
||||||
|
-
|
||||||
|
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
|
||||||
|
name: Fortis
|
||||||
|
state: bank
|
||||||
|
bank: base.res_bank_1
|
||||||
|
-
|
||||||
|
I create a new employee “John”
|
||||||
|
-
|
||||||
|
!record {model: hr.employee, id: hr_employee_john}:
|
||||||
|
address_home_id: base.res_partner_address_2
|
||||||
|
address_id: base.res_partner_address_9
|
||||||
|
birthday: '1984-05-01'
|
||||||
|
children: 0.0
|
||||||
|
country_id: base.in
|
||||||
|
department_id: hr.dep_it
|
||||||
|
gender: male
|
||||||
|
marital: single
|
||||||
|
name: John
|
||||||
|
bank_account_id: res_partner_bank_0
|
||||||
|
vehicle_distance: 0.0
|
||||||
|
-
|
||||||
|
I create a salary structure for 'Software Developer'
|
||||||
|
-
|
||||||
|
!record {model: hr.payroll.structure, id: hr_payroll_structure_softwaredeveloper}:
|
||||||
|
name: Salary Structure for Software Developer
|
||||||
|
code: SD
|
||||||
|
company_id: base.main_company
|
||||||
|
parent_id: hr_payroll.structure_base
|
||||||
|
rule_ids:
|
||||||
|
- hr_payroll.hr_payslip_line_houserantallowance1
|
||||||
|
- hr_payroll.hr_payslip_line_convanceallowance1
|
||||||
|
- hr_payroll.hr_payslip_line_professionaltax1
|
||||||
|
- hr_payroll.hr_payslip_line_providentfund1
|
||||||
|
- hr_payroll.hr_salary_rule_meal_voucher
|
||||||
|
- hr_payroll.hr_salary_rule_sales_commission
|
||||||
|
-
|
||||||
|
I create a contract for 'John'
|
||||||
|
-
|
||||||
|
!record {model: hr.contract, id: hr_contract_john}:
|
||||||
|
date_end: !eval "'%s-%s-%s' %(datetime.now().year+1,datetime.now().month,datetime.now().day)"
|
||||||
|
date_start: !eval time.strftime('%Y-%m-%d')
|
||||||
|
name: Contract for John
|
||||||
|
wage: 5000.0
|
||||||
|
type_id: hr_contract.hr_contract_type_emp
|
||||||
|
employee_id: hr_employee_john
|
||||||
|
struct_id: hr_payroll_structure_softwaredeveloper
|
||||||
|
working_hours: resource.timesheet_group1
|
||||||
|
-
|
||||||
|
I create a Payslip
|
||||||
|
-
|
||||||
|
!record {model: hr.payslip, id: hr_payslip_0}:
|
||||||
|
employee_id: hr_employee_john
|
||||||
|
journal_id: account.expenses_journal
|
||||||
|
-
|
||||||
|
I select employee John
|
||||||
|
-
|
||||||
|
!python {model: hr.payslip}: |
|
||||||
|
import time
|
||||||
|
from datetime import datetime
|
||||||
|
from dateutil import relativedelta
|
||||||
|
date_from = time.strftime('%Y-%m-01')
|
||||||
|
worked_days_obj = self.pool.get('hr.payslip.worked_days')
|
||||||
|
date_to = str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10]
|
||||||
|
res = self.onchange_employee_id(cr, uid, [], date_from, date_to, ref("hr_employee_john"), False, None)
|
||||||
|
vals = {
|
||||||
|
'struct_id': res['value']['struct_id'],
|
||||||
|
'contract_id': res['value']['contract_id'],
|
||||||
|
'name': res['value']['name'],
|
||||||
|
}
|
||||||
|
vals['worked_days_line_ids'] = [(0,0,i) for i in res['value']['worked_days_line_ids']]
|
||||||
|
vals['input_line_ids'] = [(0,0,i) for i in res['value']['input_line_ids']]
|
||||||
|
self.write(cr, uid, ref("hr_payslip_0"), vals)
|
||||||
|
-
|
||||||
|
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})
|
||||||
|
-
|
||||||
|
I verify the payslip is in draft state
|
||||||
|
-
|
||||||
|
!python {model: hr.payslip}: |
|
||||||
|
from tools.translate import _
|
||||||
|
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
|
||||||
|
assert(payslip_brw.state == 'draft'), _('State not changed!')
|
||||||
|
-
|
||||||
|
I click on 'Compute Sheet' button
|
||||||
|
-
|
||||||
|
!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"),
|
||||||
|
})
|
||||||
|
-
|
||||||
|
Then I click on the 'Confirm' button
|
||||||
|
-
|
||||||
|
!workflow {model: hr.payslip, action: hr_verify_sheet, ref: hr_payslip_0}
|
||||||
|
-
|
||||||
|
I verify that the Accounting Entries are created
|
||||||
|
-
|
||||||
|
!python {model: hr.payslip}: |
|
||||||
|
payslip = self.browse(cr, uid, ref("hr_payslip_0"))
|
||||||
|
assert payslip.move_id, "Accounting Entries has not been created"
|
||||||
|
-
|
||||||
|
I verify that the payslip is in done state
|
||||||
|
-
|
||||||
|
!python {model: hr.payslip}: |
|
||||||
|
from tools.translate import _
|
||||||
|
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
|
||||||
|
assert(payslip_brw.state == 'done'), _('State not changed!')
|
Loading…
Reference in New Issue