2010-10-19 11:14:23 +00:00
|
|
|
-
|
|
|
|
In order to test the PDF reports defined on an invoice, we will create a Invoice Record
|
|
|
|
-
|
|
|
|
!record {model: account.invoice, id: test_invoice_1}:
|
2010-10-27 12:44:06 +00:00
|
|
|
currency_id: base.EUR
|
2010-10-19 11:14:23 +00:00
|
|
|
company_id: base.main_company
|
2012-06-19 07:16:24 +00:00
|
|
|
partner_id: base.res_partner_1
|
2010-10-19 11:14:23 +00:00
|
|
|
state: draft
|
|
|
|
type: out_invoice
|
|
|
|
account_id: account.a_recv
|
|
|
|
name: Test invoice 1
|
2010-09-15 12:15:34 +00:00
|
|
|
-
|
2010-09-27 17:53:35 +00:00
|
|
|
In order to test the PDF reports defined on an invoice, we will print an Invoice Report
|
2010-10-11 11:28:45 +00:00
|
|
|
-
|
2010-09-15 12:15:34 +00:00
|
|
|
!python {model: account.invoice}: |
|
2013-02-09 06:29:29 +00:00
|
|
|
import os
|
2013-02-22 13:35:11 +00:00
|
|
|
import openerp.report
|
|
|
|
from openerp import tools
|
|
|
|
data, format = openerp.report.render_report(cr, uid, [ref('account.account_invoice_customer0')], 'account.invoice', {}, {})
|
2010-09-15 12:15:34 +00:00
|
|
|
if tools.config['test_report_directory']:
|
2010-09-16 05:40:15 +00:00
|
|
|
file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data)
|
|
|
|
|
2010-09-15 12:15:34 +00:00
|
|
|
-
|
2010-09-16 05:40:15 +00:00
|
|
|
In order to test the PDF reports defined on a partner, we will print the Overdue Report
|
2010-10-11 11:28:45 +00:00
|
|
|
-
|
2010-09-15 12:15:34 +00:00
|
|
|
!python {model: res.partner}: |
|
2013-02-09 06:29:29 +00:00
|
|
|
import os
|
2013-02-22 13:35:11 +00:00
|
|
|
import openerp.report
|
|
|
|
from openerp import tools
|
|
|
|
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', {}, {})
|
2010-09-15 12:15:34 +00:00
|
|
|
if tools.config['test_report_directory']:
|
2010-09-16 05:40:15 +00:00
|
|
|
file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data)
|
|
|
|
-
|
|
|
|
Print the Aged Partner Balance Report
|
|
|
|
-
|
2010-12-22 09:18:44 +00:00
|
|
|
!python {model: account.account}: |
|
|
|
|
ctx={}
|
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2011-01-04 12:20:09 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 10:49:35 +00:00
|
|
|
-
|
|
|
|
Print the Account Balance Sheet in Normal mode
|
2010-09-16 08:33:41 +00:00
|
|
|
-
|
|
|
|
!python {model: account.account}: |
|
2010-12-21 12:26:21 +00:00
|
|
|
ctx={}
|
2011-12-23 08:13:54 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'), 'account_report_id': ref('account_financial_report_balancesheet0')}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2011-12-01 11:55:21 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 10:49:35 +00:00
|
|
|
-
|
2010-12-20 13:23:37 +00:00
|
|
|
Print the Account Balance Report in Normal mode through the wizard - From Account Chart
|
2010-09-16 10:49:35 +00:00
|
|
|
-
|
|
|
|
!python {model: account.account}: |
|
2010-12-20 13:23:37 +00:00
|
|
|
ctx={}
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-20 13:23:37 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 12:05:21 +00:00
|
|
|
-
|
2010-09-16 14:44:14 +00:00
|
|
|
Print the Central Journal Report - From Account
|
2010-09-16 12:05:21 +00:00
|
|
|
-
|
|
|
|
!python {model: account.journal.period}: |
|
2010-12-22 09:18:44 +00:00
|
|
|
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')]
|
2010-12-21 12:47:00 +00:00
|
|
|
ctx={}
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-21 12:47:00 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_central_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 14:44:14 +00:00
|
|
|
-
|
|
|
|
Print the General Journal Report - From Journal
|
|
|
|
-
|
|
|
|
!python {model: account.journal.period}: |
|
2010-12-22 09:18:44 +00:00
|
|
|
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')]
|
2010-12-21 12:47:00 +00:00
|
|
|
ctx={}
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-21 12:47:00 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_general_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 14:44:14 +00:00
|
|
|
-
|
|
|
|
Print the General Ledger Report in Normal Mode
|
|
|
|
-
|
|
|
|
!python {model: account.account}: |
|
2010-12-22 05:56:50 +00:00
|
|
|
ctx={}
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-22 05:56:50 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 14:44:14 +00:00
|
|
|
-
|
|
|
|
Print the General Ledger Report in Landscape Mode
|
|
|
|
-
|
|
|
|
!python {model: account.account}: |
|
2010-12-22 05:56:50 +00:00
|
|
|
ctx={}
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-22 05:56:50 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 15:21:11 +00:00
|
|
|
-
|
|
|
|
Print Journal Report - From Model
|
|
|
|
-
|
|
|
|
!python {model: account.journal.period}: |
|
2010-12-22 09:18:44 +00:00
|
|
|
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')]
|
2010-12-22 07:04:27 +00:00
|
|
|
ctx={}
|
2012-02-03 15:14:23 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'), 'period_from':ref('period_1'), 'period_to':ref('period_12')}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-21 12:47:00 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_print_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 15:21:11 +00:00
|
|
|
-
|
|
|
|
Print the Partner Balance Report
|
|
|
|
-
|
2010-12-22 09:18:44 +00:00
|
|
|
!python {model: account.account}: |
|
|
|
|
ctx={}
|
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-22 09:18:44 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_partner_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 15:58:03 +00:00
|
|
|
-
|
|
|
|
Print the Partner Ledger Report
|
|
|
|
-
|
2010-12-22 09:18:44 +00:00
|
|
|
!python {model: account.account}: |
|
|
|
|
ctx={}
|
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'page_split': True}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-22 09:18:44 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 15:58:03 +00:00
|
|
|
-
|
|
|
|
Print the Partner Ledger-Other Report
|
|
|
|
-
|
|
|
|
!python {model: res.partner}: |
|
2010-12-22 09:18:44 +00:00
|
|
|
ctx={}
|
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'page_split': False}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-22 09:18:44 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 15:58:03 +00:00
|
|
|
-
|
|
|
|
Print the Profit-Loss Report in Normal Mode
|
|
|
|
-
|
|
|
|
!python {model: account.account}: |
|
2010-12-21 07:37:01 +00:00
|
|
|
ctx={}
|
2011-12-23 08:13:54 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2011-12-01 11:55:21 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-12-23 08:44:31 +00:00
|
|
|
-
|
|
|
|
Print the Analytic Balance Report through the wizard
|
|
|
|
-
|
|
|
|
!python {model: account.analytic.account}: |
|
|
|
|
ctx={}
|
|
|
|
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
|
|
|
|
data_dict = {}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-23 08:44:31 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
|
|
|
|
|
|
|
-
|
|
|
|
Print the Cost Ledger Report through the wizard
|
|
|
|
-
|
|
|
|
!python {model: account.analytic.account}: |
|
|
|
|
ctx={}
|
|
|
|
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')]})
|
|
|
|
data_dict = {}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-23 08:44:31 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
|
|
|
|
|
|
|
|
-
|
|
|
|
Print the Cost Ledger(Only Quantities) Report through the wizard
|
|
|
|
-
|
|
|
|
!python {model: account.analytic.account}: |
|
|
|
|
ctx={}
|
|
|
|
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')]})
|
|
|
|
data_dict = {}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-23 08:44:31 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
|
|
|
|
|
|
|
-
|
|
|
|
Print the Analytic Journal Report through the wizard
|
|
|
|
-
|
|
|
|
!python {model: account.analytic.journal}: |
|
|
|
|
ctx={}
|
|
|
|
ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]})
|
|
|
|
data_dict = {}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2010-12-23 08:44:31 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
|
|
|
|
|
|
|
-
|
|
|
|
Print the Inverted Analytic Balance Report through the wizard
|
|
|
|
-
|
|
|
|
!python {model: account.analytic.account}: |
|
|
|
|
ctx={}
|
|
|
|
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
|
|
|
|
data_dict = {}
|
2013-02-09 06:24:36 +00:00
|
|
|
from openerp.tools import test_reports
|
2011-01-04 12:20:09 +00:00
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')
|