diff --git a/account_banking_ach_credit_transfer/post_install.py b/account_banking_ach_credit_transfer/post_install.py index 8da2cc55..4c681ab6 100644 --- a/account_banking_ach_credit_transfer/post_install.py +++ b/account_banking_ach_credit_transfer/post_install.py @@ -5,13 +5,11 @@ def update_bank_journals(cr, registry): - with api.Environment.manage(): - 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)]}) - return + 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)]})