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
|
|
|
|
address_invoice_id: base.res_partner_address_tang
|
|
|
|
partner_id: base.res_partner_asus
|
|
|
|
state: draft
|
|
|
|
type: out_invoice
|
|
|
|
account_id: account.a_recv
|
|
|
|
name: Test invoice 1
|
|
|
|
address_contact_id: base.res_partner_address_tang
|
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}: |
|
|
|
|
import netsvc, tools, os
|
2010-10-28 07:13:17 +00:00
|
|
|
(data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.account_invoice_customer0')], {}, {})
|
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}: |
|
|
|
|
import netsvc, tools, os
|
2010-09-16 16:38:39 +00:00
|
|
|
(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')], {}, {})
|
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)
|
2010-09-16 21:27:23 +00:00
|
|
|
-
|
|
|
|
In order to test the PDF reports defined on Account Move, we will print the Voucher Report
|
2010-10-11 11:28:45 +00:00
|
|
|
-
|
2010-09-16 21:27:23 +00:00
|
|
|
!python {model: account.move}: |
|
|
|
|
import netsvc, tools, os
|
|
|
|
(data, format) = netsvc.LocalService('report.account.move.voucher').create(cr, uid, [ref('account.account_move_0')], {}, {})
|
|
|
|
if tools.config['test_report_directory']:
|
|
|
|
file(os.path.join(tools.config['test_report_directory'], 'account-voucher-report.'+format), 'wb+').write(data)
|
2010-09-16 05:40:15 +00:00
|
|
|
-
|
|
|
|
Print the Aged Partner Balance Report
|
|
|
|
-
|
2010-12-22 09:18:44 +00:00
|
|
|
!python {model: account.account}: |
|
|
|
|
ctx={}
|
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
|
|
|
from tools import test_reports
|
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 08:33:41 +00:00
|
|
|
-
|
2010-09-16 21:27:23 +00:00
|
|
|
Print the Account Balance Sheet in Horizontal mode
|
2010-09-16 10:49:35 +00:00
|
|
|
-
|
|
|
|
!python {model: account.account}: |
|
2010-12-21 12:26:21 +00:00
|
|
|
ctx={}
|
2010-12-22 07:04:27 +00:00
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
|
2010-12-21 12:26:21 +00:00
|
|
|
from tools import test_reports
|
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_bs_report',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={}
|
2010-12-22 07:04:27 +00:00
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
|
2010-12-21 12:26:21 +00:00
|
|
|
from tools import test_reports
|
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_bs_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={}
|
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
2010-12-20 13:23:37 +00:00
|
|
|
from tools import test_reports
|
|
|
|
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
|
|
|
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
2010-12-21 12:47:00 +00:00
|
|
|
from tools import test_reports
|
|
|
|
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
|
|
|
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
2010-12-21 12:47:00 +00:00
|
|
|
from tools import test_reports
|
|
|
|
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 07:04:27 +00:00
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False}
|
2010-12-22 05:56:50 +00:00
|
|
|
from tools import test_reports
|
|
|
|
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 07:04:27 +00:00
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True}
|
2010-12-22 05:56:50 +00:00
|
|
|
from tools import test_reports
|
|
|
|
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={}
|
2010-12-22 09:18:44 +00:00
|
|
|
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
|
|
|
data_dict = {'chart_account_id':ref('account.chart0')}
|
2010-12-21 12:47:00 +00:00
|
|
|
from tools import test_reports
|
|
|
|
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')}
|
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
|
|
|
from tools import test_reports
|
|
|
|
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}
|
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
|
|
|
from tools import test_reports
|
|
|
|
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}
|
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
|
|
|
from tools import test_reports
|
|
|
|
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={}
|
2010-12-22 07:04:27 +00:00
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
|
2010-12-21 07:37:01 +00:00
|
|
|
from tools import test_reports
|
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
|
2010-09-16 15:58:03 +00:00
|
|
|
-
|
|
|
|
Print the Profit-Loss Report in Horizontal Mode
|
|
|
|
-
|
|
|
|
!python {model: account.account}: |
|
2010-12-21 07:37:01 +00:00
|
|
|
ctx={}
|
2010-12-22 07:04:27 +00:00
|
|
|
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
2010-12-22 09:18:44 +00:00
|
|
|
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
|
2010-12-21 07:37:01 +00:00
|
|
|
from tools import test_reports
|
|
|
|
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
|