[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
This commit is contained in:
Ivan Yelizariev
2018-11-20 07:41:48 +00:00
parent c9229aa949
commit a0bda6bcf2
+1 -1
View File
@@ -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':