[IMP] hr_attendance, hr_timesheet_invoice, hr_payroll : yml report test added

bzr revid: rme@tinyerp.com-20100916122949-gisdwwxrjc7xia6t
This commit is contained in:
RME (OpenERP) 2010-09-16 17:59:49 +05:30
parent 1d6c6b4ffc
commit ba148dba0a
5 changed files with 40 additions and 2 deletions

View File

@ -43,7 +43,7 @@
'wizard/hr_attendance_sign_in_out_view.xml',
],
'demo_xml': ['hr_attendance_demo.xml'],
'test': ['test/test_hr_attendance.yml'],
'test': ['test/test_hr_attendance.yml','test/hr_attendance_error.yml'],
'installable': True,
'active': False,
'certificate': '0063495605613',

View File

@ -0,0 +1,9 @@
-
In order to test the PDF reports defined on a hr attendance error, we will print a hr attendance error
-
!python {model: hr.employee}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.hr.attendance.error').create(cr, uid, [], {'model': 'hr.employee', 'form': {'init_date': '2010-09-16', 'end_date': '2010-09-16', 'id': 1, 'emp_ids': [ref('hr.employee2')], 'max_delay': 120}}
, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-report.'+format), 'wb+').write(data)

View File

@ -17,3 +17,21 @@
file(os.path.join(tools.config['test_report_directory'], 'hr_payslip_report.'+format), 'wb+').write(data)
(data, format) = netsvc.LocalService('report.payslip.pdf').create(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], {}, {})
-
Print the employee salary details
-
!python {model: hr.payslip}: |
import netsvc, tools, os, time
data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'employee_ids': [ref('hr.employee2')]}}
(data, format) = netsvc.LocalService('report.employees.salary').create(cr, uid, [], data_dict, {'periods': []})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_salary_detai_report.'+format), 'wb+').write(data)
-
Print the employee yearly salary details
-
!python {model: hr.payslip}: |
import netsvc, tools, os, time
data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'salary_on': 'current_month', 'employee_ids': [ref('hr.employee2')]}}
(data, format) = netsvc.LocalService('report.year.salary').create(cr, uid, [], data_dict, {'periods': []})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_yearly_salary_detai_report.'+format), 'wb+').write(data)

View File

@ -47,7 +47,9 @@ reports, eso.""",
],
'demo_xml': ['hr_timesheet_invoice_demo.xml',
],
'test': ['test/test_hr_timesheet_invoice.yml'],
'test': ['test/test_hr_timesheet_invoice.yml'
'test/hr_timesheet_invoice_report.yml',
],
'installable': True,
'active': False,
'certificate': '0056091842381',

View File

@ -0,0 +1,9 @@
-
In order to test the PDF reports defined on a hr timesheet invoice, we will print a hr timesheet invoice
-
!python {model: account.analytic.line}: |
import netsvc, tools, os, time
data_dict = {'model': 'ir.ui.menu', 'form': {'id': 1, 'date_from': '2010-09-01', 'employee_ids': [[6, 0, [1, ref('hr.employee2')]]], 'journal_ids': [[6, 0, [1, 2, 3, 4]]], 'date_to': '2010-09-16'}}
(data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {'periods': []})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-report.'+format), 'wb+').write(data)