From 1c63d103be92f6a303d5cd6194e01fc63ef70837 Mon Sep 17 00:00:00 2001 From: ilo Date: Mon, 8 Jul 2024 14:38:58 -0300 Subject: [PATCH] [17.0][FIX] account_payment_mode: error when payment mode --- account_payment_mode/models/account_journal.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/account_payment_mode/models/account_journal.py b/account_payment_mode/models/account_journal.py index 8941a9cd010..b5ed0269d0d 100644 --- a/account_payment_mode/models/account_journal.py +++ b/account_payment_mode/models/account_journal.py @@ -19,8 +19,13 @@ def _default_inbound_payment_methods(self): method_info = self.env[ "account.payment.method" ]._get_payment_method_information() + allowed_modes = ["unique"] + if "payment_provider_id" in self.env["account.payment.method.line"]._fields: + allowed_modes.append("electronic") unique_codes = tuple( - code for code, info in method_info.items() if info.get("mode") == "unique" + code + for code, info in method_info.items() + if info.get("mode") in allowed_modes ) all_in = self.env["account.payment.method"].search( [