From 00a6b7d22f1f81c743ec1b3a0351d806eecfdf92 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 9 Feb 2023 09:33:00 +0100 Subject: [PATCH] [FIX] account_banking_sepa_*: Remove post-installs From this version, Odoo already includes code on the account.payment.method creation for adding such method to each journal: https://github.com/odoo/odoo/blob/a93ed75cb80f16f/addons/account/models/account_payment_method.py#L24-L38 so we don't need to explicitly create them for the new payment methods we are adding in these modules. TT41146 --- .../__init__.py | 1 - .../__manifest__.py | 1 - .../post_install.py | 24 ------------------- 3 files changed, 26 deletions(-) delete mode 100644 account_banking_sepa_credit_transfer/post_install.py diff --git a/account_banking_sepa_credit_transfer/__init__.py b/account_banking_sepa_credit_transfer/__init__.py index e2b93a535..0650744f6 100644 --- a/account_banking_sepa_credit_transfer/__init__.py +++ b/account_banking_sepa_credit_transfer/__init__.py @@ -1,2 +1 @@ from . import models -from .post_install import update_bank_journals diff --git a/account_banking_sepa_credit_transfer/__manifest__.py b/account_banking_sepa_credit_transfer/__manifest__.py index f849519be..bcd9fc3f6 100644 --- a/account_banking_sepa_credit_transfer/__manifest__.py +++ b/account_banking_sepa_credit_transfer/__manifest__.py @@ -14,6 +14,5 @@ "depends": ["account_banking_pain_base"], "data": ["data/account_payment_method.xml"], "demo": ["demo/sepa_credit_transfer_demo.xml"], - "post_init_hook": "update_bank_journals", "installable": True, } diff --git a/account_banking_sepa_credit_transfer/post_install.py b/account_banking_sepa_credit_transfer/post_install.py deleted file mode 100644 index fe9cf853f..000000000 --- a/account_banking_sepa_credit_transfer/post_install.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2016-2020 Akretion (Alexis de Lattre ) -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from odoo import SUPERUSER_ID, api - - -def update_bank_journals(cr, registry): - 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