[IMP] Changed all module categories, limited number of categories
[odoo/odoo.git] / addons / hr_payroll / test / payment_advice.yml
1 -
2   I test the 'Payment Advice' in order to check the hr_payroll in OpenERP
3 -
4   I create a new employee “Richie”
5 -
6   !record {model: hr.employee, id: hr_employee_richie0}:
7     address_home_id: base.res_partner_address_1
8     address_id: base.res_partner_address_9
9     birthday: '1984-05-01'
10     children: 0.0
11     contract_ids:
12       - advantages_gross: 0.0
13         advantages_net: 0.0
14         date_end: !eval "'%s-%s-%s' %(datetime.now().year+1,datetime.now().month,datetime.now().day)"
15         date_start: !eval time.strftime('%Y-%m-%d')
16         name: reference
17         wage: 5000.0
18         wage_type_id: hr_contract.hr_contract_monthly_gross
19         type_id: hr_contract.hr_contract_type_emp
20     country_id: base.in
21     department_id: hr.dep_it
22     gender: male
23     marital: hr.hr_employee_marital_status_single
24     name: Richie
25     vehicle_distance: 0.0
26 -
27   I create a new payment advice record
28 -
29   !record {model: hr.payroll.advice, id: hr_payroll_advice_advice0}:
30     line_ids:
31       - amount: 5500.0
32         bysal: 5000.0
33         employee_id: 'hr_employee_richie0'
34         flag: C
35         name: Axis Bank
36     name: advice1
37 -
38   I confirmed the sheet by click on "Confirm Sheet" button.
39 -
40   !python {model: hr.payroll.advice}: |
41     self.confirm_sheet(cr, uid, [ref("hr_payroll_advice_advice0")], {"lang": "en_US",
42       "active_model": "ir.ui.menu", "active_ids": [ref("hr_payroll.hr_menu_payment_advice")],
43       "tz": False, "active_id": ref("hr_payroll.hr_menu_payment_advice")})
44 -
45  I check that a state is "Confirm"
46 -
47   !python {model: hr.payroll.advice}: |
48     from tools.translate import _
49     advice_id=self.browse(cr, uid, ref("hr_payroll_advice_advice0"))
50     assert(advice_id.state == 'confirm'), _('State not changed!')
51
52 -
53   Print Payroll Advice
54 -
55   !python {model: hr.payroll.advice}: |
56     import netsvc, tools, os
57     (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('hr_payroll_advice_advice0')], {}, {})
58     if tools.config['test_report_directory']:
59        file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payroll-advice.'+format), 'wb+').write(data)