diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py index 9ed2b76e1ed..18e585effc2 100644 --- a/addons/hr_attendance/__openerp__.py +++ b/addons/hr_attendance/__openerp__.py @@ -43,7 +43,9 @@ 'wizard/hr_attendance_sign_in_out_view.xml', ], 'demo_xml': ['hr_attendance_demo.xml'], - 'test': ['test/test_hr_attendance.yml','test/hr_attendance_error.yml'], + 'test': ['test/test_hr_attendance.yml', + 'test/hr_attendance_error_report.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 deleted file mode 100644 index 6c045871cb5..00000000000 --- a/addons/hr_attendance/test/hr_attendance_error.yml +++ /dev/null @@ -1,9 +0,0 @@ -- - 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_attendance/test/hr_attendance_error_report.yml b/addons/hr_attendance/test/hr_attendance_error_report.yml new file mode 100644 index 00000000000..d7ca06587c7 --- /dev/null +++ b/addons/hr_attendance/test/hr_attendance_error_report.yml @@ -0,0 +1,29 @@ +- + 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, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + start = DateTime(int(start.year), int(start.month), int(start.day)) + data_dict = {'model': 'hr.employee', 'form': {'init_date': start.strftime('%Y-%m-%d'), 'end_date':start.strftime('%Y-%m-%d'), 'emp_ids': [ref('hr.employee2')], 'max_delay': 120}} + (data, format) = netsvc.LocalService('report.hr.attendance.error').create(cr, uid, [], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-error_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a HR Attendance By Month, we will print a HR Attendance By Month +- + !python {model: hr.employee}: | + import netsvc, tools, os, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + year=start.year + month=start.month + start = DateTime(int(start.year), int(start.month), int(start.day)) + data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year': year }} + (data, format) = netsvc.LocalService('report.hr.attendance.bymonth').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee2')]}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-by_month_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/hr_expense/test/hr_expense_report.yml b/addons/hr_expense/test/hr_expense_report.yml index 52a44e0dafb..4c81ceb5976 100644 --- a/addons/hr_expense/test/hr_expense_report.yml +++ b/addons/hr_expense/test/hr_expense_report.yml @@ -5,4 +5,4 @@ import netsvc, tools, os (data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.hr_expense_expense_septemberexpenses0'),ref('hr_expense.hr_expense_expense_septemberexpenses1')], {}, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_expense_report.'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py index 7d68b216494..e6d901ad02c 100644 --- a/addons/hr_holidays/__openerp__.py +++ b/addons/hr_holidays/__openerp__.py @@ -65,7 +65,9 @@ 'board_hr_holidays_view.xml', ], 'demo_xml': ['hr_holidays_demo.xml',], - 'test': ['test/test_hr_holiday.yml'], + 'test': ['test/test_hr_holiday.yml', + 'test/hr_holidays_report.yml', + ], 'installable': True, 'active': False, 'certificate': '0086579209325', diff --git a/addons/hr_holidays/test/hr_holidays_report.yml b/addons/hr_holidays/test/hr_holidays_report.yml new file mode 100644 index 00000000000..fb8eb6319a0 --- /dev/null +++ b/addons/hr_holidays/test/hr_holidays_report.yml @@ -0,0 +1,13 @@ +- + In order to test the PDF reports defined on a HR Holidays, we will print a HR Holidays +- + !python {model: hr.holidays}: | + import netsvc, tools, os, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + start = DateTime(int(start.year), int(start.month), int(start.day)) + data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': start.strftime('%Y-%m-%d'), 'depts' : [ref('hr.dep_sales')],'holiday_type' : 'Validated' }} + (data, format) = netsvc.LocalService('report.holidays.summary').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee2')]}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_holidays-summary_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 88a797b6827..69ca8328ea6 100644 --- a/addons/hr_payroll/test/hr_payroll_report.yml +++ b/addons/hr_payroll/test/hr_payroll_report.yml @@ -5,7 +5,7 @@ import netsvc, tools, os (data, format) = netsvc.LocalService('report.salary.structure').create(cr, uid, [ref('hr_payroll.hr_employee_bonamy0')], {}, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_emp_salary_report.'+format), 'wb+').write(data) + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-salary_report.'+format), 'wb+').write(data) - In order to test the PDF reports defined on a HR Payslip, we will print a HR Payslip @@ -14,11 +14,10 @@ import netsvc, tools, os (data, format) = netsvc.LocalService('report.payslip.pdf').create(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], {}, {}) if tools.config['test_report_directory']: - 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')], {}, {}) + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data) - - Print the employee salary details + In order to test the PDF reports defined on a HR Employee Salary Details, we will print a HR Employee Salary Details - !python {model: hr.payslip}: | import netsvc, tools, os, time @@ -27,7 +26,7 @@ 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 + In order to test the PDF reports defined on a HR Employee Salary Details, we will print a HR Employee Salary Details - !python {model: hr.payslip}: | import netsvc, tools, os, time diff --git a/addons/hr_timesheet/__openerp__.py b/addons/hr_timesheet/__openerp__.py index c7207b6761c..5a2e37353cd 100644 --- a/addons/hr_timesheet/__openerp__.py +++ b/addons/hr_timesheet/__openerp__.py @@ -50,7 +50,9 @@ to set up a management by affair. 'wizard/hr_timesheet_sign_in_out_view.xml', ], 'demo_xml': ['hr_timesheet_demo.xml'], - 'test': ['test/test_hr_timesheet.yml'], + 'test': ['test/test_hr_timesheet.yml', + 'test/hr_timesheet_invoice_report.yml', + ], 'installable': True, 'active': False, 'certificate': '0071405533469', diff --git a/addons/hr_timesheet/test/hr_timesheet_report.yml b/addons/hr_timesheet/test/hr_timesheet_report.yml new file mode 100644 index 00000000000..04c07d77403 --- /dev/null +++ b/addons/hr_timesheet/test/hr_timesheet_report.yml @@ -0,0 +1,31 @@ +- + In order to test the PDF reports defined on a HR Timesheet User Report, we will print a HR Timesheet User Report +- + !python {model: hr.employee}: | + import netsvc, tools, os, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + start = DateTime(int(start.year), int(start.month), int(start.day)) + month=start.month + year=start.year + data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_id' : ref('base.user_root') }} + (data, format) = netsvc.LocalService('report.hr.analytical.timesheet').create(cr, uid, [], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-user_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a HR Timesheet Users Report, we will print a HR Timesheet Users Report +- + !python {model: hr.employee}: | + import netsvc, tools, os, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + start = DateTime(int(start.year), int(start.month), int(start.day)) + month=start.month + year=start.year + data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_ids' : [ref('base.user_root')] }} + (data, format) = netsvc.LocalService('report.hr.analytical.timesheet_users').create(cr, uid, [], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml index 434d04a979d..118699c4aa3 100644 --- a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml +++ b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml @@ -1,9 +1,23 @@ - - In order to test the PDF reports defined on a hr timesheet invoice, we will print a hr timesheet invoice + In order to test the PDF reports defined on a HR Timesheet Account Analytic Profit, we will print a HR Timesheet Account Analytic Profit - !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_dict = {'model': 'ir.ui.menu', 'form': {'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 + file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-account_analytic_profit_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a HR Cost Ledger, we will print a HR Cost Ledger +- + !python {model: account.analytic.account}: | + import netsvc, tools, os, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + start = DateTime(int(start.year), int(start.month), int(start.day)) + data_dict = {'model': 'ir.ui.menu', 'form': {'date1': start.strftime('%Y-%m-%d'), 'date2': start.strftime('%Y-%m-%d')}} + (data, format) = netsvc.LocalService('report.hr.timesheet.invoice.account.analytic.account.cost_ledger').create(cr, uid, [], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-cost_ledger_report.'+format), 'wb+').write(data) \ No newline at end of file