[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
This commit is contained in:
Pedro M. Baeza
2023-02-09 09:33:00 +01:00
committed by Dũng (Trần Đình)
parent 0e7832d1fd
commit 00a6b7d22f
3 changed files with 0 additions and 26 deletions

View File

@@ -1,2 +1 @@
from . import models
from .post_install import update_bank_journals

View File

@@ -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,
}

View File

@@ -1,24 +0,0 @@
# Copyright 2016-2020 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# 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