[FIX] account: chart of account installation cannot find a transfer account
Before this commit: For a couple of clients, the installation of a chart of accounts crashes because a transfer account is not found. This account should have been created automatically, but hasn't, or has been deleted. After this commit: If no transfer account is found, no account is linked to the "Transfer account" field of the company, but the installation doesn't crash. closes odoo/odoo#36693 Opw: 2066557 X-original-commit: d93e5c12bab233d727a6cfb519e77f5fabb73912 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
committed by
fw-bot
parent
682067f54e
commit
b1afea13d4
@@ -230,7 +230,7 @@ class AccountChartTemplate(models.Model):
|
||||
acc_template_ref, taxes_ref = self._install_template(company, code_digits=self.code_digits)
|
||||
|
||||
# Set the transfer account on the company
|
||||
company.transfer_account_id = self.env['account.account'].search([('code', '=like', self.transfer_account_code_prefix + '%')])[0]
|
||||
company.transfer_account_id = self.env['account.account'].search([('code', '=like', self.transfer_account_code_prefix + '%')])[:1]
|
||||
|
||||
# Create Bank journals
|
||||
self._create_bank_journals(company, acc_template_ref)
|
||||
|
||||
Reference in New Issue
Block a user