summaryrefslogtreecommitdiff
path: root/addons/account/tests/test_reconciliation_widget.py
diff options
context:
space:
mode:
authorwan <wan@odoo.com>2019-02-08 10:11:41 +0000
committerwan <wan@odoo.com>2019-02-08 10:11:41 +0000
commit969705fa2ae8bfd5e2d2cfce0241fcd56bebf01f (patch)
treeddfc35a278f022c3c62962a14b587de49bb67f4a /addons/account/tests/test_reconciliation_widget.py
parent723789b6b1997568943bcf2fa879b8471838ec19 (diff)
[ADD] account: suspense account management
Task 1930403 Purpose: A suspense account is an account in the general ledger that temporarily stores any transactions for which there is uncertainty about the account in which they should be recorded. Once the accounting staff investigates and clarifies the purpose of this type of transaction, it shifts the transaction out of the suspense account and into the correct account(s). An entry into a suspense account may be a debit or a credit. The Chosen Odoo approach (macro) for this case is 1) from bank statement -> reconciliation widget -> reconciliation model 2) create move that have a dedicated checkbox 3) be able to reopen the bank statement line "like if there is no linked account move" and finally reconcile the transaction with the good invoice/bill (we can reprocess account move "to check") 4) when we reprocess, Instead of creating an account move : Check if there is an "to check" existing linked account move and remove all the account move lines then replace them by the good ones --> we want to keep the sequence closes odoo/odoo#30486
Diffstat (limited to 'addons/account/tests/test_reconciliation_widget.py')
-rw-r--r--addons/account/tests/test_reconciliation_widget.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/addons/account/tests/test_reconciliation_widget.py b/addons/account/tests/test_reconciliation_widget.py
index 5d2dc637ed7..7b5f21ee325 100644
--- a/addons/account/tests/test_reconciliation_widget.py
+++ b/addons/account/tests/test_reconciliation_widget.py
@@ -1,6 +1,7 @@
import logging
import odoo.tests
import time
+import requests
_logger = logging.getLogger(__name__)
@@ -12,13 +13,17 @@ class TestUi(odoo.tests.HttpCase):
def test_01_admin_bank_statement_reconciliation(self):
bank_stmt_name = 'BNK/%s/0001' % time.strftime('%Y')
- bank_stmt = self.env['account.bank.statement'].search([('name', '=', bank_stmt_name)])
- if not bank_stmt:
+ bank_stmt_line = self.env['account.bank.statement'].search([('name', '=', bank_stmt_name)]).mapped('line_ids')
+ if not bank_stmt_line:
_logger.exception('Could not find bank statement %s' % bank_stmt_name)
# To be able to test reconciliation, admin user must have access to accounting features, so we give him the right group for that
self.env.ref('base.user_admin').write({'groups_id': [(4, self.env.ref('account.group_account_user').id)]})
+
+ payload = {'action':'bank_statement_reconciliation_view', 'statement_line_ids[]': bank_stmt_line.ids}
+ prep = requests.models.PreparedRequest()
+ prep.prepare_url(url="http://localhost/web#", params=payload)
- self.phantom_js("/web#statement_ids=" + str(bank_stmt.id) + "&action=bank_statement_reconciliation_view",
+ self.phantom_js(prep.url.replace('http://localhost','').replace('?','#'),
"odoo.__DEBUG__.services['web_tour.tour'].run('bank_statement_reconciliation')",
"odoo.__DEBUG__.services['web_tour.tour'].tours.bank_statement_reconciliation.ready", login="admin")