mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[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
This commit is contained in:
committed by
Dũng (Trần Đình)
parent
aae524f5d8
commit
83e8af1afe
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user