Server IP : 127.0.0.2 / Your IP : 3.15.195.46 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 : |
- !context journal_type: 'bank' - In order to test Bank Statement feature of account I create a bank statement line and confirm it and check it's move created - I select the period and journal for the bank statement - !python {model: account.bank.statement, id: False}: | import time journal = self.with_context({'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu', 'journal_type': 'bank', 'date': time.strftime("%Y/%m/%d")})._default_journal() assert journal, 'Journal has not been selected' - I create a bank statement with Opening and Closing balance 0. - !record {model: account.bank.statement, id: account_bank_statement_0}: balance_end_real: 0.0 balance_start: 0.0 date: !eval time.strftime('%Y-%m-%d') company_id: base.main_company - !python {model: account.bank.statement.line, id: False}: | import time account_id = self.env['account.account'].search([('user_type_id.type', '=', 'liquidity'), ('currency_id', '=', False)], limit=1).id vals = { 'amount': 1000, 'date': time.strftime('%Y-%m-%d'), 'partner_id': ref('base.res_partner_4'), 'name': 'EXT001', 'statement_id': ref('account_bank_statement_0'), } self.create(vals) - I process the bank statement line - !python {model: account.bank.statement, id: False}: | account = self.env['account.account'].create({'name': 'toto', 'code': 'bidule', 'user_type_id': self.env.ref('account.data_account_type_fixed_assets').id}) statement = self.browse([ref("account_bank_statement_0")]) statement.line_ids[0].process_reconciliation(new_aml_dicts=[{ 'credit': 1000, 'debit': 0, 'name': 'toto', 'account_id': account.id, }]) - I modify the bank statement and set the Closing Balance. - !record {model: account.bank.statement, id: account_bank_statement_0}: balance_end_real: 1000.0 - I confirm the bank statement using Confirm button - !python {model: account.bank.statement, id: False}: | self.browse(ref("account_bank_statement_0")).button_confirm_bank() - I check that bank statement state is now "Closed" - !assert {model: account.bank.statement, id: account_bank_statement_0}: - state == 'confirm'