[FIX] account: correct test on closing fiscal year to fail with error message and...
[odoo/odoo.git] / addons / account / test / account_report.yml
1 -
2   In order to test the PDF reports defined on an invoice, we will create a Invoice Record
3 -
4   !record {model: account.invoice, id: test_invoice_1}:
5     currency_id: base.EUR
6     company_id: base.main_company
7     partner_id: base.res_partner_1
8     state: draft
9     type: out_invoice
10     account_id: account.a_recv
11     name: Test invoice 1
12 -
13   In order to test the PDF reports defined on an invoice, we will print an Invoice Report
14 -
15   !python {model: account.invoice}: |
16     import netsvc, tools, os
17     (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.account_invoice_customer0')], {}, {})
18     if tools.config['test_report_directory']:
19         file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data)
20
21 -
22   In order to test the PDF reports defined on a partner, we will print the Overdue Report
23 -
24   !python {model: res.partner}: |
25     import netsvc, tools, os
26     (data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_1'),ref('base.res_partner_2'),ref('base.res_partner_12')], {}, {})
27     if tools.config['test_report_directory']:
28         file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data)
29 -
30   Print the Aged Partner Balance Report
31 -
32   !python {model: account.account}: |
33     ctx={}
34     data_dict = {'chart_account_id':ref('account.chart0')}
35     from tools import test_reports
36     test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
37 -
38   Print the Account Balance Sheet in Normal mode
39 -
40   !python {model: account.account}: |
41     ctx={}
42     data_dict = {'chart_account_id':ref('account.chart0'), 'account_report_id': ref('account_financial_report_balancesheet0')}
43     from tools import test_reports
44     test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
45 -
46   Print the Account Balance Report in Normal mode through the wizard - From Account Chart
47 -
48   !python {model: account.account}: |
49     ctx={}
50     data_dict = {'chart_account_id':ref('account.chart0')}
51     from tools import test_reports
52     test_reports.try_report_action(cr, uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account')
53 -
54   Print the Central Journal Report - From Account
55 -
56   !python {model: account.journal.period}: |
57     journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
58                          ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
59     ctx={}
60     data_dict = {'chart_account_id':ref('account.chart0')}
61     from tools import test_reports
62     test_reports.try_report_action(cr, uid, 'action_account_central_journal',wiz_data=data_dict, context=ctx, our_module='account')
63 -
64   Print the General Journal Report - From Journal
65 -
66   !python {model: account.journal.period}: |
67     journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
68                          ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
69     ctx={}
70     data_dict = {'chart_account_id':ref('account.chart0')}
71     from tools import test_reports
72     test_reports.try_report_action(cr, uid, 'action_account_general_journal',wiz_data=data_dict, context=ctx, our_module='account')
73 -
74   Print the General Ledger Report in Normal Mode
75 -
76   !python {model: account.account}: |
77     ctx={}
78     data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False}
79     from tools import test_reports
80     test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
81 -
82   Print the General Ledger Report in Landscape Mode
83 -
84   !python {model: account.account}: |
85     ctx={}
86     data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True}
87     from tools import test_reports
88     test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
89 -
90   Print Journal Report - From Model
91 -
92   !python {model: account.journal.period}: |
93     journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
94     ctx={}
95     data_dict = {'chart_account_id':ref('account.chart0'), 'period_from':ref('period_1'), 'period_to':ref('period_12')}
96     from tools import test_reports
97     test_reports.try_report_action(cr, uid, 'action_account_print_journal',wiz_data=data_dict, context=ctx, our_module='account')
98 -
99   Print the Partner Balance Report
100 -
101   !python {model: account.account}: |
102     ctx={}
103     data_dict = {'chart_account_id':ref('account.chart0')}
104     from tools import test_reports
105     test_reports.try_report_action(cr, uid, 'action_account_partner_balance',wiz_data=data_dict, context=ctx, our_module='account')
106 -
107   Print the Partner Ledger Report
108 -
109   !python {model: account.account}: |
110     ctx={}
111     data_dict = {'chart_account_id':ref('account.chart0'),'page_split': True}
112     from tools import test_reports
113     test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
114 -
115   Print the Partner Ledger-Other Report
116 -
117   !python {model: res.partner}: |
118     ctx={}
119     data_dict = {'chart_account_id':ref('account.chart0'),'page_split': False}
120     from tools import test_reports
121     test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
122 -
123   Print the Profit-Loss Report in Normal Mode
124 -
125   !python {model: account.account}: |
126     ctx={}
127     data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
128     from tools import test_reports
129     test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
130 -
131  Print the Analytic Balance Report through the wizard
132 -
133   !python {model: account.analytic.account}: |
134     ctx={}
135     ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
136     data_dict = {}
137     from tools import test_reports
138     test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
139
140 -
141  Print the Cost Ledger Report through the wizard
142 -
143   !python {model: account.analytic.account}: |
144     ctx={}
145     ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
146     data_dict = {}
147     from tools import test_reports
148     test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
149
150 -
151  Print the Cost Ledger(Only Quantities) Report through the wizard
152 -
153   !python {model: account.analytic.account}: |
154     ctx={}
155     ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
156     data_dict = {}
157     from tools import test_reports
158     test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
159
160 -
161  Print the Analytic Journal Report through the wizard
162 -
163   !python {model: account.analytic.journal}: |
164     ctx={}
165     ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]})
166     data_dict = {}
167     from tools import test_reports
168     test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
169
170 -
171  Print the Inverted Analytic Balance Report through the wizard
172 -
173   !python {model: account.analytic.account}: |
174     ctx={}
175     ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
176     data_dict = {}
177     from tools import test_reports
178     test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')