odoo/addons/hr_timesheet/test/hr_timesheet_report.yml

23 lines
1.2 KiB
YAML

-
In order to test the PDF reports defined on HR Timesheet User Report, we will print a HR Timesheet User Report
-
!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, 'user_id' : uid }}
(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)
-
In order to test the PDF reports defined on HR Timesheet Users Report, we will print a HR Timesheet Users Report
-
!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, 'user_ids' : [uid] }}
(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)