[FIX] payment: _inverse_journal_id behaviour when missing a payment_method

When computing the inverse of `journal_id` on a batch of
`payment.acquirer`, a payment method is created if there isn't any.
As this process can only be done for one acquirer at a time, we must
populate the data accordingly.

closes odoo/odoo#74668

X-original-commit: 493b1ca54d6831f044726b2d8942e7e7f7ce3098
Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
Arnaud Baes
2021-08-03 17:47:18 +00:00
parent ddd20cb0e8
commit 98c403a1bf
+2 -2
View File
@@ -184,8 +184,8 @@ class PaymentAcquirer(models.Model):
if acquirer.journal_id:
if not payment_method:
self.env['account.payment.method.line'].create({
'payment_method_id': self._get_default_payment_method(),
'journal_id': self.journal_id.id,
'payment_method_id': acquirer._get_default_payment_method(),
'journal_id': acquirer.journal_id.id,
})
else:
payment_method.journal_id = acquirer.journal_id