Server IP : 127.0.0.2 / Your IP : 3.23.128.245 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /opt/odoo/addons/account/test/ |
Upload File : |
- 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}: currency_id: base.EUR company_id: base.main_company partner_id: base.res_partner_1 state: draft type: out_invoice account_id: account.a_recv name: Test invoice 1 - In order to test the PDF reports defined on an invoice, we will print an Invoice Report - !python {model: account.invoice, id: False}: | import os import odoo.report from odoo import tools data, format = odoo.report.render_report(self.env.cr, self.env.uid, [ref('account.account_invoice_customer0')], 'account.report_invoice', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) - In order to test the PDF reports defined on a partner, we will print the Overdue Report - !python {model: res.partner, id: False}: | import os import odoo.report from odoo import tools data, format = odoo.report.render_report(self.env.cr, self.env.uid, [ref('base.res_partner_1'),ref('base.res_partner_2'),ref('base.res_partner_12')], 'account.report_overdue', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data) - Print the Aged Partner Balance Report - !python {model: account.account, id: False}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0')} from odoo.tools import test_reports test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account') - Print the Account Balance Sheet in Normal mode - !python {model: account.account, id: False}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'account_report_id': ref('account_financial_report_balancesheet0')} from odoo.tools import test_reports test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Account Balance Report in Normal mode through the wizard - From Account Chart - !python {model: account.account, id: False}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0')} from odoo.tools import test_reports test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account') - Print the General Ledger Report (in Landscape Mode) - !python {model: account.account, id: False}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0')} from odoo.tools import test_reports test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account') - Print the Profit-Loss Report in Normal Mode - !python {model: account.account, id: False}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')} from odoo.tools import test_reports test_reports.try_report_action(self.env.cr, self.env.uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')