mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[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:
committed by
Reyes4711
parent
8c42b0849b
commit
90c280c0b0
@@ -1,3 +1,2 @@
|
||||
from . import models
|
||||
from . import wizards
|
||||
from .post_install import update_bank_journals
|
||||
|
||||
@@ -33,6 +33,5 @@
|
||||
"views/report_sepa_direct_debit_mandate.xml",
|
||||
],
|
||||
"demo": ["demo/sepa_direct_debit_demo.xml"],
|
||||
"post_init_hook": "update_bank_journals",
|
||||
"installable": True,
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# Copyright 2016 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")])
|
||||
sdd = env.ref("account_banking_sepa_direct_debit.sepa_direct_debit")
|
||||
if sdd:
|
||||
journals.write(
|
||||
{
|
||||
"inbound_payment_method_line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{"payment_method_id": sdd.id, "name": "SEPA Direct Debit"},
|
||||
)
|
||||
]
|
||||
}
|
||||
)
|
||||
return
|
||||
Reference in New Issue
Block a user