From eebbdb9584b964ba671ba50b104d8d91dc181d70 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 4 Feb 2020 12:39:58 +0000 Subject: [PATCH] [FIX] account: on CoA install, need to only take the first transfer account With the commit some time ago #d382288, I removed to take the first, but you can have multiple transfer accounts in one company. The best way is to just do a limit=1 closes odoo/odoo#44607 X-original-commit: aab5cb4ce6d7850a042203d62915dcc37f4d8bd9 Signed-off-by: oco-odoo --- addons/account/models/chart_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index c79687d06db..21b05a3049b 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -252,7 +252,7 @@ class AccountChartTemplate(models.Model): # Set the transfer account on the company company.transfer_account_id = self.env['account.account'].search([ - ('code', '=like', self.transfer_account_code_prefix + '%'), ('company_id', '=', company.id)]) + ('code', '=like', self.transfer_account_code_prefix + '%'), ('company_id', '=', company.id)], limit=1) # Create Bank journals self._create_bank_journals(company, acc_template_ref)