-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13b3844
commit d8d8c33
Showing
2 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
auth_api_key_server_env/migrations/16.0.1.0.0/post-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from odoo import SUPERUSER_ID, api | ||
|
||
|
||
def migrate(cr, version): | ||
env = api.Environment(cr, SUPERUSER_ID, {}) | ||
keys = env['auth.api.key'].search([("tech_name", '=', False), ("name", "!=", False)]) | ||
for key in keys: | ||
key.write({"tech_name": key._normalize_tech_name(key.name)}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters