diff options
| author | Paul Morelle <pmo@odoo.com> | 2021-03-05 17:39:12 +0000 |
|---|---|---|
| committer | Paul Morelle <pmo@odoo.com> | 2021-03-05 17:53:29 +0000 |
| commit | e883fffaebd05727b399b26ca86cc54df79cde93 (patch) | |
| tree | d131caaba52dc90fe70741d438728f1ab6bd882d /addons | |
| parent | e9c89569dec46f03ed37100b73105bc243944ed7 (diff) | |
[FIX] account: avoid useless account move synchronization
Account move synchronization has already taken place during the creation
of the moves. No need for this additional check during the
reconciliation itself.
This commit helps when a lot of move lines are being reconciled at once.
For instance, the duration of the reconciliation of a batch of about 700
payments on a large database took 20 minutes before this commit, and
takes about 4 minutes after this commit.
closes odoo/odoo#67408
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/models/account_bank_statement.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 56f0cca3b2f..b345d02d605 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -1248,6 +1248,7 @@ class AccountBankStatementLine(models.Model): line_vals_list = [reconciliation_vals['line_vals'] for reconciliation_vals in reconciliation_overview] new_lines = self.env['account.move.line'].create(line_vals_list) + new_lines = new_lines.with_context(skip_account_move_synchronization=True) for reconciliation_vals, line in zip(reconciliation_overview, new_lines): if reconciliation_vals.get('payment'): accounts = (self.journal_id.payment_debit_account_id, self.journal_id.payment_credit_account_id) |
