[Imp] hr : improvements in yml file
bzr revid: jas@tinyerp.com-20101221120740-pk26ccemrndtd45k
This commit is contained in:
parent
0d7fee1423
commit
43f73c6898
|
@ -1,19 +1,21 @@
|
|||
-
|
||||
In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance By Month
|
||||
Print the HR Attendance Report By Month through the wizard
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'hr.employee', 'form': {'month': time.gmtime()[1], 'year': time.gmtime()[0]}}
|
||||
(data, format) = netsvc.LocalService('report.hr.attendance.bymonth').create(cr, uid, [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-by_month_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
data_dict = {'month': time.gmtime()[1], 'year': time.gmtime()[0]}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_attendance_month',wiz_data=data_dict, context=ctx, our_module='hr_attendance')
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance Error
|
||||
-
|
||||
Print HR Attendance Error Report through the wizard
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'hr.employee', 'form': {'init_date': time.strftime('%Y-01-01'), 'end_date':time.strftime('%Y-%m-%d'), 'emp_ids': [ref('hr.employee1')], 'max_delay': 120}}
|
||||
(data, format) = netsvc.LocalService('report.hr.attendance.error').create(cr, uid, [ref('hr.employee1')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-error_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1')]})
|
||||
data_dict = {'init_date': time.strftime('%Y-01-01'), 'end_date':time.strftime('%Y-%m-%d'), 'max_delay': 120 }
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_attendance_error',wiz_data=data_dict, context=ctx, our_module='hr_attendance')
|
||||
|
|
|
@ -1,14 +1,22 @@
|
|||
-
|
||||
In order to test the PDF reports defined on a HR Holidays, we will print HR Holidays
|
||||
Print the HR Holidays(Summary Department) Report through the wizard
|
||||
-
|
||||
!python {model: hr.holidays}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'depts' : [ref('hr.dep_sales')],'holiday_type' : 'Validated' }}
|
||||
(data, format) = netsvc.LocalService('report.holidays.summary').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_holidays-dept_summary_report.'+format), 'wb+').write(data)
|
||||
|
||||
data_dict = {'model': 'hr.employee', 'form': {'date_from': time.strftime('%Y-%m-01'), 'depts' : [ref('hr.dep_sales')],'holiday_type' : 'Validated','emp':[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')] }}
|
||||
(data, format) = netsvc.LocalService('report.holidays.summary').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_holidays-employee_summary_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.department','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
data_dict = {'date_from': time.strftime('%Y-%m-01'), 'depts' : [(6,0,[ref('hr.dep_sales')])],'holiday_type' : 'Validated'}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_holidays_summary_dept',wiz_data=data_dict, context=ctx, our_module='hr_holidays')
|
||||
|
||||
-
|
||||
Print the HR Holidays(Summary Employee) Report through the wizard
|
||||
-
|
||||
!python {model: hr.holidays}: |
|
||||
import netsvc, tools, os, time
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
data_dict = {'date_from': time.strftime('%Y-%m-01'), 'emp' : [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')])],'holiday_type' : 'Validated'}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_holidays_summary_employee',wiz_data=data_dict, context=ctx, our_module='hr_holidays')
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
# 'test/payslip.yml',
|
||||
# 'test/payment_advice.yml',
|
||||
# 'test/payroll_register.yml',
|
||||
# 'test/hr_payroll_report.yml',
|
||||
'test/hr_payroll_report.yml',
|
||||
],
|
||||
'demo_xml': [
|
||||
'hr_payroll_demo.xml'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
-
|
||||
In order to test the PDF reports defined on HR Payroll, we will print Employees' Salary Structure
|
||||
-
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.salary.structure').create(cr, uid, [ref('hr_payroll.hr_employee_bonamy0')], {}, {})
|
||||
|
@ -9,7 +9,7 @@
|
|||
|
||||
-
|
||||
Print HR Payslip
|
||||
-
|
||||
-
|
||||
!python {model: hr.payslip}: |
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.payslip.pdf').create(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], {}, {})
|
||||
|
@ -17,23 +17,25 @@
|
|||
file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data)
|
||||
|
||||
-
|
||||
Print HR Employee Salary Details
|
||||
Print Employee Salary Statement through wizard
|
||||
-
|
||||
!python {model: hr.payslip}: |
|
||||
import netsvc, tools, os, time
|
||||
emp_ids = [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'employee_ids': emp_ids, 'ids':emp_ids }}
|
||||
(data, format) = netsvc.LocalService('report.employees.salary').create(cr, uid, [], data_dict, {'active_ids': emp_ids})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_salary_detail_report.'+format), 'wb+').write(data)
|
||||
-
|
||||
Print HR Employee Salary Details Annual basis
|
||||
-
|
||||
!python {model: hr.payslip}: |
|
||||
import netsvc, tools, os, time
|
||||
emp_ids = [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]
|
||||
data_dict = {'model': 'hr.payslip', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'salary_on': 'current_month', 'employee_ids': emp_ids, 'ids':emp_ids}}
|
||||
(data, format) = netsvc.LocalService('report.year.salary').create(cr, uid, [], data_dict,{'active_ids': emp_ids} )
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_yearly_salary_detail_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]})
|
||||
data_dict = {'employee_ids': [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')])], 'date_from': time.strftime('%Y-01-01'), 'date_to': time.strftime('%Y-%m-%d')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_payroll_employees_detail',wiz_data=data_dict, context=ctx, our_module='hr_payroll')
|
||||
|
||||
-
|
||||
Print Salary Register through wizard
|
||||
-
|
||||
!python {model: hr.payslip}: |
|
||||
import netsvc, tools, os, time
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.payslip','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]})
|
||||
data_dict = {'employee_ids': [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')])], 'date_from': time.strftime('%Y-01-01'), 'date_to': time.strftime('%Y-%m-%d')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_payroll_year_salary',wiz_data=data_dict, context=ctx, our_module='hr_payroll')
|
||||
|
||||
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
-
|
||||
In order to test the PDF reports defined on Employee, we will print Timesheet of a User
|
||||
Print the HR Timesheet By Employee report through the wizard
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os, time
|
||||
month = time.gmtime()[1]
|
||||
year = time.gmtime()[0]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'employee_id' : ref('hr.employee1') }}
|
||||
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-user_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': []})
|
||||
data_dict = {'month': time.gmtime()[1], 'year': time.gmtime()[0], 'employee_id' : ref('hr.employee1')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_timesheet_my',wiz_data=data_dict, context=ctx, our_module='hr_timesheet')
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on Employee, we will print Timesheet of Users
|
||||
Print the HR Timesheet By Employee report through the wizard
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os, time
|
||||
month = time.gmtime()[1]
|
||||
year = time.gmtime()[0]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'employee_ids' : [ref('hr.employee1')] }}
|
||||
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet_users').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': []})
|
||||
data_dict = {'month': time.gmtime()[1], 'year': time.gmtime()[0], 'employee_ids' : [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')])]}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_timesheet_users',wiz_data=data_dict, context=ctx, our_module='hr_timesheet')
|
|
@ -7,14 +7,14 @@
|
|||
(data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
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 HR Cost Ledger, we will print report of HR Cost Ledger
|
||||
Print the HR Cost Ledger report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
import netsvc, tools, os, time
|
||||
ctx={}
|
||||
acc_ids = [ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_sednacom'),ref('account.analytic_thymbra'),ref('account.analytic_partners_camp_to_camp')]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'date1': time.strftime('%Y-01-01'), 'date2': time.strftime('%Y-%m-%d')}}
|
||||
(data, format) = netsvc.LocalService('report.hr.timesheet.invoice.account.analytic.account.cost_ledger').create(cr, uid, acc_ids, data_dict, {'active_ids': acc_ids})
|
||||
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)
|
||||
ctx.update({'model': 'ir.ui.menu','active_ids': acc_ids})
|
||||
data_dict = {'date1': time.strftime('%Y-01-01'), 'date2': time.strftime('%Y-%m-%d')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_timesheet_invoice_cost_ledger',wiz_data=data_dict, context=ctx, our_module='hr_timesheet_invoice')
|
||||
|
|
Loading…
Reference in New Issue