From ba148dba0a21f895b698801ff35158d80e08989d Mon Sep 17 00:00:00 2001 From: "RME (OpenERP)" Date: Thu, 16 Sep 2010 17:59:49 +0530 Subject: [PATCH] [IMP] hr_attendance, hr_timesheet_invoice, hr_payroll : yml report test added bzr revid: rme@tinyerp.com-20100916122949-gisdwwxrjc7xia6t --- addons/hr_attendance/__openerp__.py | 2 +- .../hr_attendance/test/hr_attendance_error.yml | 9 +++++++++ addons/hr_payroll/test/hr_payroll_report.yml | 18 ++++++++++++++++++ addons/hr_timesheet_invoice/__openerp__.py | 4 +++- .../test/hr_timesheet_invoice_report.yml | 9 +++++++++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 addons/hr_attendance/test/hr_attendance_error.yml create mode 100644 addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py index 5a79566bcde..9ed2b76e1ed 100644 --- a/addons/hr_attendance/__openerp__.py +++ b/addons/hr_attendance/__openerp__.py @@ -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', diff --git a/addons/hr_attendance/test/hr_attendance_error.yml b/addons/hr_attendance/test/hr_attendance_error.yml new file mode 100644 index 00000000000..6c045871cb5 --- /dev/null +++ b/addons/hr_attendance/test/hr_attendance_error.yml @@ -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) \ No newline at end of file diff --git a/addons/hr_payroll/test/hr_payroll_report.yml b/addons/hr_payroll/test/hr_payroll_report.yml index 4d3fda41de7..88a797b6827 100644 --- a/addons/hr_payroll/test/hr_payroll_report.yml +++ b/addons/hr_payroll/test/hr_payroll_report.yml @@ -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) \ No newline at end of file diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py index f9be64cc454..df44302ec56 100644 --- a/addons/hr_timesheet_invoice/__openerp__.py +++ b/addons/hr_timesheet_invoice/__openerp__.py @@ -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', diff --git a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml new file mode 100644 index 00000000000..434d04a979d --- /dev/null +++ b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml @@ -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) \ No newline at end of file