[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:
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user