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

bzr revid: rme@tinyerp.com-20100917072806-t86i3yit9ceiofk9
This commit is contained in:
RME (OpenERP) 2010-09-17 12:58:06 +05:30
parent 9fb0234dba
commit a2b9eaeccf
10 changed files with 104 additions and 21 deletions

View File

@ -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',

View File

@ -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)

View File

@ -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)

View File

@ -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)
file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data)

View File

@ -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',

View File

@ -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)

View File

@ -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

View File

@ -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',

View File

@ -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)

View File

@ -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)
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)