From 3f3c30887ca64b1ffd491a39dacef509eb2282e1 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Tue, 5 Jul 2016 17:31:08 +0200 Subject: [PATCH] [FIX] account: bank statement reconciliation speed improvement. Removed assertion statement that was making a useless browse on account.move. This single patch is enough to divide by 4 the time of preprocessing a bank statement when opening its reconciliation widget. That removed assertion is now a supposed prerequisite when calling the function and should be tested first (on batch of records). --- addons/account/models/account_bank_statement.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 943beb0b285..f6d88bc3b36 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -795,6 +795,7 @@ class AccountBankStatementLine(models.Model): items, as well as a journal item for the bank statement line. Finally, mark the statement line as reconciled by putting the matched moves ids in the column journal_entry_ids. + :param self: browse collection of records that are supposed to have no accounting entries already linked. :param (list of dicts) counterpart_aml_dicts: move lines to create to reconcile with existing payables/receivables. The expected keys are : - 'name' @@ -829,8 +830,6 @@ class AccountBankStatementLine(models.Model): counterpart_moves = self.env['account.move'] # Check and prepare received data - if self.journal_entry_ids.ids: - raise UserError(_('The bank statement line was already reconciled.')) if any(rec.statement_id for rec in payment_aml_rec): raise UserError(_('A selected move line was already reconciled.')) for aml_dict in counterpart_aml_dicts: