From a0bda6bcf244dd413f5bf1ab0010a209fe1322bb Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 19 Nov 2018 11:23:33 +0000 Subject: [PATCH] [FIX] account: fix code of transfer account Transfer accounts created for payment acquirers was ignoring the prefix of the main transfer accounts and was always creating accounts with code 000001, 000002, etc. The reason is because the method was called on an empty recordset closes odoo/odoo#28789 --- addons/payment/models/payment_acquirer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 17e5f26f8fb..b2ab12b1a94 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -229,7 +229,7 @@ class PaymentAcquirer(models.Model): :return: a dictionary to create a account.journal record. ''' self.ensure_one() - account_vals = self.env['account.chart.template']._prepare_transfer_account_for_direct_creation(self.name, self.company_id) + account_vals = self.company_id.chart_template_id._prepare_transfer_account_for_direct_creation(self.name, self.company_id) account = self.env['account.account'].create(account_vals) inbound_payment_method_ids = [] if self.token_implemented and self.payment_flow == 's2s':