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