diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 22cc1b88db449ea8569d333d201c19aac84f4580..c0c3fd4d31b9d9653115354edfea2374f5fb9fb4 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -341,7 +341,14 @@ class AccountBankStatement(models.Model): def action_bank_reconcile_bank_statements(self): self.ensure_one() - bank_stmt_lines = self.mapped('line_ids') + limit = int(self.env["ir.config_parameter"].get_param("account.reconcile.batch", 1000)) + bank_stmt_lines = self.env['account.bank.statement.line'].search([ + ('statement_id', 'in', self.ids), + # take not reconciled lines only. See _check_lines_reconciled method + ('account_id', '=', False), + ('journal_entry_ids', '=', False), + ('amount', '!=', 0), + ], limit=limit) return { 'type': 'ir.actions.client', 'tag': 'bank_statement_reconciliation_view', diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py index c3dc0f8752d4299b54c94a2f55ead32e653322f2..c4089e67252e282c347bcfed0047ae0c11bbb5ba 100644 --- a/addons/account/models/account_journal_dashboard.py +++ b/addons/account/models/account_journal_dashboard.py @@ -423,7 +423,15 @@ class account_journal(models.Model): def action_open_reconcile(self): if self.type in ['bank', 'cash']: # Open reconciliation view for bank statements belonging to this journal - bank_stmt = self.env['account.bank.statement'].search([('journal_id', 'in', self.ids)]).mapped('line_ids') + limit = int(self.env["ir.config_parameter"].get_param("account.reconcile.batch", 1000)) + bank_stmt = self.env['account.bank.statement.line'].search([ + ('journal_id', 'in', self.ids), + # take not reconciled lines only. See _check_lines_reconciled method + ('account_id', '=', False), + ('journal_entry_ids', '=', False), + ('amount', '!=', 0), + ], limit=limit) + return { 'type': 'ir.actions.client', 'tag': 'bank_statement_reconciliation_view',