2
In order to test the PDF reports defined on Account, Print a Financial Statement Report
4
!python {model: account.report.report}: |
5
import netsvc, tools, os
6
(data, format) = netsvc.LocalService('report.accounting.report').create(cr, uid, [ref('account_report.account_report_1')], {}, {})
7
if tools.config['test_report_directory']:
8
file(os.path.join(tools.config['test_report_directory'], 'account_report-financial_statement_report.'+format), 'wb+').write(data)
10
Print the Indicators Report in Normal mode
12
!python {model: account.report.history }: |
13
import netsvc, tools, os, time
14
data_dict = {'model': 'ir.ui.menu', 'form': {'select_base':'year','base_selection':[ref('account.data_fiscalyear')],'context':{}}}
15
(data, format) = netsvc.LocalService('report.print.indicators').create(cr, uid, [], data_dict, {})
16
if tools.config['test_report_directory']:
17
file(os.path.join(tools.config['test_report_directory'], 'account_report-indicators_report.'+format), 'wb+').write(data)
b'\\ No newline at end of file'