From e8127eec0885f5cc65db11ab74912d60b53205eb Mon Sep 17 00:00:00 2001 From: David Ramia Date: Wed, 6 Jul 2022 14:00:22 +0200 Subject: [PATCH] [FIX] account_banking_pain_base, account_banking_sepa_credit_transfer, account_banking_direct_debit: Remove Environment.manage() Environment.manage() is deprecated in v 15.0 --- .../post_install.py | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/account_banking_sepa_credit_transfer/post_install.py b/account_banking_sepa_credit_transfer/post_install.py index 8cfd84b8f..fe9cf853f 100644 --- a/account_banking_sepa_credit_transfer/post_install.py +++ b/account_banking_sepa_credit_transfer/post_install.py @@ -5,21 +5,20 @@ from odoo import SUPERUSER_ID, api def update_bank_journals(cr, registry): - with api.Environment.manage(): - env = api.Environment(cr, SUPERUSER_ID, {}) - ajo = env["account.journal"] - journals = ajo.search([("type", "=", "bank")]) - sct = env.ref("account_banking_sepa_credit_transfer.sepa_credit_transfer") - if sct: - journals.write( - { - "outbound_payment_method_line_ids": [ - ( - 0, - 0, - {"payment_method_id": sct.id, "name": "SEPA Direct Credit"}, - ) - ] - } - ) + env = api.Environment(cr, SUPERUSER_ID, {}) + ajo = env["account.journal"] + journals = ajo.search([("type", "=", "bank")]) + sct = env.ref("account_banking_sepa_credit_transfer.sepa_credit_transfer") + if sct: + journals.write( + { + "outbound_payment_method_line_ids": [ + ( + 0, + 0, + {"payment_method_id": sct.id, "name": "SEPA Direct Credit"}, + ) + ] + } + ) return