From a5f71f90743fd36b00de3b2a6523f8e4958ba6aa Mon Sep 17 00:00:00 2001 From: JordiMForgeFlow Date: Fri, 13 Dec 2024 10:06:53 +0100 Subject: [PATCH] [IMP] account_banking_ach_credit_transfer: remove post install Odoo already creates automatically a payment method line in the bank journals --- account_banking_ach_credit_transfer/__init__.py | 1 - .../__manifest__.py | 1 - .../post_install.py | 15 --------------- 3 files changed, 17 deletions(-) delete mode 100644 account_banking_ach_credit_transfer/post_install.py diff --git a/account_banking_ach_credit_transfer/__init__.py b/account_banking_ach_credit_transfer/__init__.py index f1a6eca6..83e553ac 100644 --- a/account_banking_ach_credit_transfer/__init__.py +++ b/account_banking_ach_credit_transfer/__init__.py @@ -1,4 +1,3 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models -from .post_install import update_bank_journals diff --git a/account_banking_ach_credit_transfer/__manifest__.py b/account_banking_ach_credit_transfer/__manifest__.py index 1110a4ac..13d1fef2 100644 --- a/account_banking_ach_credit_transfer/__manifest__.py +++ b/account_banking_ach_credit_transfer/__manifest__.py @@ -12,6 +12,5 @@ "depends": ["account_banking_ach_base"], "data": ["data/account_payment_method.xml"], "demo": ["demo/ach_credit_transfer_demo.xml"], - "post_init_hook": "update_bank_journals", "installable": True, } diff --git a/account_banking_ach_credit_transfer/post_install.py b/account_banking_ach_credit_transfer/post_install.py deleted file mode 100644 index 4c681ab6..00000000 --- a/account_banking_ach_credit_transfer/post_install.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2018 Thinkwell Designs -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from odoo import SUPERUSER_ID, api - - -def update_bank_journals(cr, registry): - env = api.Environment(cr, SUPERUSER_ID, {}) - journals = env["account.journal"].search([("type", "=", "bank")]) - ach_ct = env.ref( - "account_banking_ach_credit_transfer.ach_credit_transfer", - raise_if_not_found=False, - ) - if ach_ct: - journals.write({"outbound_payment_method_line_ids": [(4, ach_ct.id)]})