mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-22 10:02:02 +02:00
19.0 vanilla
This commit is contained in:
parent
ba20ce7443
commit
768b70e05e
2357 changed files with 1057103 additions and 712486 deletions
|
|
@ -4,21 +4,17 @@ from . import controllers
|
|||
from . import models
|
||||
from . import wizards
|
||||
|
||||
from odoo import api, SUPERUSER_ID
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
def post_init_hook(env):
|
||||
""" Create `account.payment.method` records for the installed payment providers. """
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
PaymentProvider = env['payment.provider']
|
||||
installed_providers = PaymentProvider.search([('module_id.state', '=', 'installed')])
|
||||
for code in set(installed_providers.mapped('code')):
|
||||
PaymentProvider._setup_payment_method(code)
|
||||
|
||||
|
||||
def uninstall_hook(cr, registry):
|
||||
def uninstall_hook(env):
|
||||
""" Delete `account.payment.method` records created for the installed payment providers. """
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
installed_providers = env['payment.provider'].search([('module_id.state', '=', 'installed')])
|
||||
env['account.payment.method'].search([
|
||||
('code', 'in', installed_providers.mapped('code')),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue