[ADD]: new view for Unrealized Gains and losses
[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     address_invoice_id: base.res_partner_address_tang
8     partner_id: base.res_partner_asus
9     state: draft
10     type: out_invoice
11     account_id: account.a_recv
12     name: Test invoice 1
13     address_contact_id: base.res_partner_address_tang
14 -
15   In order to test the PDF reports defined on an invoice, we will print an Invoice Report
16 -
17   !python {model: account.invoice}: |
18     import netsvc, tools, os
19     (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.account_invoice_customer0')], {}, {})
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 netsvc, tools, os
28     (data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_asus'),ref('base.res_partner_agrolait'),ref('base.res_partner_c2c')], {}, {})
29     if tools.config['test_report_directory']:
30         file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data)
31 -
32   Print the Aged Partner Balance Report
33 -
34   !python {model: account.account}: |
35     ctx={}
36     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
37     data_dict = {'chart_account_id':ref('account.chart0')}
38     from 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 Horizontal mode
42 -
43   !python {model: account.account}: |
44     ctx={}
45     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
46     data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
47     from tools import test_reports
48     test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
49 -
50   Print the Account Balance Sheet in Normal mode
51 -
52   !python {model: account.account}: |
53     ctx={}
54     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
55     data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
56     from tools import test_reports
57     test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
58 -
59   Print the Account Balance Report in Normal mode through the wizard - From Account Chart
60 -
61   !python {model: account.account}: |
62     ctx={}
63     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
64     data_dict = {'chart_account_id':ref('account.chart0')}
65     from tools import test_reports
66     test_reports.try_report_action(cr, uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account')
67 -
68   Print the Central Journal Report - From Account
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     ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
75     data_dict = {'chart_account_id':ref('account.chart0')}
76     from tools import test_reports
77     test_reports.try_report_action(cr, uid, 'action_account_central_journal',wiz_data=data_dict, context=ctx, our_module='account')
78 -
79   Print the General Journal Report - From Journal
80 -
81   !python {model: account.journal.period}: |
82     journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
83                          ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
84     ctx={}
85     ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
86     data_dict = {'chart_account_id':ref('account.chart0')}
87     from tools import test_reports
88     test_reports.try_report_action(cr, uid, 'action_account_general_journal',wiz_data=data_dict, context=ctx, our_module='account')
89 -
90   Print the General Ledger Report in Normal Mode
91 -
92   !python {model: account.account}: |
93     ctx={}
94     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
95     data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False}
96     from tools import test_reports
97     test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
98 -
99   Print the General Ledger Report in Landscape Mode
100 -
101   !python {model: account.account}: |
102     ctx={}
103     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
104     data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True}
105     from tools import test_reports
106     test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
107 -
108   Print Journal Report - From Model
109 -
110   !python {model: account.journal.period}: |
111     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')]
112     ctx={}
113     ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
114     data_dict = {'chart_account_id':ref('account.chart0')}
115     from tools import test_reports
116     test_reports.try_report_action(cr, uid, 'action_account_print_journal',wiz_data=data_dict, context=ctx, our_module='account')
117 -
118   Print the Partner Balance Report
119 -
120   !python {model: account.account}: |
121     ctx={}
122     data_dict = {'chart_account_id':ref('account.chart0')}
123     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
124     from tools import test_reports
125     test_reports.try_report_action(cr, uid, 'action_account_partner_balance',wiz_data=data_dict, context=ctx, our_module='account')
126 -
127   Print the Partner Ledger Report
128 -
129   !python {model: account.account}: |
130     ctx={}
131     data_dict = {'chart_account_id':ref('account.chart0'),'page_split': True}
132     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
133     from tools import test_reports
134     test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
135 -
136   Print the Partner Ledger-Other Report
137 -
138   !python {model: res.partner}: |
139     ctx={}
140     data_dict = {'chart_account_id':ref('account.chart0'),'page_split': False}
141     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
142     from tools import test_reports
143     test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
144 -
145   Print the Profit-Loss Report in Normal Mode
146 -
147   !python {model: account.account}: |
148     ctx={}
149     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
150     data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all'}
151     from tools import test_reports
152     test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
153 -
154   Print the Profit-Loss Report in Horizontal Mode
155 -
156   !python {model: account.account}: |
157     ctx={}
158     ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
159     data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True,'target_move': 'all'}
160     from tools import test_reports
161     test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
162 -
163  Print the Analytic Balance Report through the wizard
164 -
165   !python {model: account.analytic.account}: |
166     ctx={}
167     ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
168     data_dict = {}
169     from tools import test_reports
170     test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
171
172 -
173  Print the Cost Ledger Report through the wizard
174 -
175   !python {model: account.analytic.account}: |
176     ctx={}
177     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')]})
178     data_dict = {}
179     from tools import test_reports
180     test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
181
182 -
183  Print the Cost Ledger(Only Quantities) Report through the wizard
184 -
185   !python {model: account.analytic.account}: |
186     ctx={}
187     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')]})
188     data_dict = {}
189     from tools import test_reports
190     test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
191
192 -
193  Print the Analytic Journal Report through the wizard
194 -
195   !python {model: account.analytic.journal}: |
196     ctx={}
197     ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]})
198     data_dict = {}
199     from tools import test_reports
200     test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
201
202 -
203  Print the Inverted Analytic Balance Report through the wizard
204 -
205   !python {model: account.analytic.account}: |
206     ctx={}
207     ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
208     data_dict = {}
209     from tools import test_reports
210     test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')