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