From 313bc91cf509353e5bdf8bf684589475527df7be Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 4 May 2016 11:53:35 +0200 Subject: [PATCH] [FIX] account: account selection When a user prints the GL of a given account, the GL of all accounts is printed. On a production environment, this can generate thousands of pages (and ultimately, a crash). opw-676061 --- addons/account/report/account_general_ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index 08a1d3a137c..9bd3c329ee0 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -119,7 +119,7 @@ class ReportGeneralLedger(models.AbstractModel): if data['form'].get('journal_ids', False): codes = [journal.code for journal in self.env['account.journal'].search([('id', 'in', data['form']['journal_ids'])])] - accounts = self.env['account.account'].search([]) + accounts = docs if self.model == 'account.account' else self.env['account.account'].search([]) accounts_res = self.with_context(data['form'].get('used_context',{}))._get_account_move_entry(accounts, init_balance, sortby, display_account) docargs = { 'doc_ids': self.ids,