odoo/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report...

21 lines
1.5 KiB
YAML

-
In order to test the PDF reports defined on HR Timesheet Account Analytic Profit, we will print report of HR Timesheet Account Analytic Profit
-
!python {model: account.analytic.line}: |
import netsvc, tools, os, time
data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'employee_ids': [[6,0,[ref('hr.employee_fp'), ref('hr.employee_qdp'),ref('hr.employee_al')]]], 'journal_ids': [[6,0,[ref('hr_timesheet.analytic_journal')]]], 'date_to': time.strftime('%Y-%m-%d')}}
(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)
-
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')]
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')