[IMP/FIX] Hr_holidays,hr_attendance report yml corrected
bzr revid: jvo@tinyerp.com-20100917105855-wra7gjdhk9lgovcn
This commit is contained in:
parent
8120b4dcc3
commit
5ce0c19a15
|
@ -44,7 +44,7 @@
|
|||
],
|
||||
'demo_xml': ['hr_attendance_demo.xml'],
|
||||
'test': ['test/test_hr_attendance.yml',
|
||||
'test/hr_attendance_error_report.yml'
|
||||
'test/hr_attendance_report.yml'
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
|
|
|
@ -1,29 +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, 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)
|
|
@ -0,0 +1,19 @@
|
|||
-
|
||||
In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance By Month
|
||||
-
|
||||
!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)
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance Error
|
||||
-
|
||||
!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)
|
|
@ -1,13 +1,14 @@
|
|||
-
|
||||
In order to test the PDF reports defined on a HR Holidays, we will print a HR Holidays
|
||||
In order to test the PDF reports defined on a HR Holidays, we will print 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')]})
|
||||
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-summary_report.'+format), 'wb+').write(data)
|
||||
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)
|
Loading…
Reference in New Issue