[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 <oco-odoo@users.noreply.github.com>
This commit is contained in:
Josse Colpaert
2020-02-04 15:47:32 +00:00
parent 01354a3314
commit eebbdb9584
+1 -1
View File
@@ -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)