From 98c403a1bf700a0c94d9eeb0a26aaabce82af8fc Mon Sep 17 00:00:00 2001 From: Arnaud Baes Date: Tue, 3 Aug 2021 14:49:28 +0000 Subject: [PATCH] [FIX] payment: `_inverse_journal_id` behaviour when missing a payment_method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- addons/payment/models/payment_acquirer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 5daccfe1890..f6276bfc585 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -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