mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[MIG] base_user_role_profile: Migration to 14.0
This commit is contained in:
12
base_user_role_profile/hooks.py
Normal file
12
base_user_role_profile/hooks.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# Copyright 2020 Akretion (https://www.akretion.com).
|
||||
# @author Pierrick Brun <pierrick.brun@akretion.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import SUPERUSER_ID, api
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
env["res.users"].search([("profile_id", "=", False)]).profile_id = env.ref(
|
||||
"base_user_role_profile.default_profile"
|
||||
)
|
||||
Reference in New Issue
Block a user