Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docsource/modules140-150.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Module coverage 14.0 -> 15.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| auth_signup | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| auth_totp | | |
| auth_totp |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| |new| auth_totp_mail | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
19 changes: 19 additions & 0 deletions openupgrade_scripts/scripts/auth_totp/15.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
# This method will copy records has scope = '2fa_trusted_device'
# from res_users_apikeys to auth_totp_device
openupgrade.logged_query(
env.cr,
"""INSERT INTO auth_totp_device (id, name, user_id, scope, index, key)
SELECT id, name, user_id, 'browser', index, key
FROM res_users_apikeys
WHERE scope = '2fa_trusted_device'""",
)
openupgrade.logged_query(
env.cr,
""" DELETE FROM res_users_apikeys
WHERE scope = '2fa_trusted_device'""",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---Models in module 'auth_totp'---
new model auth_totp.device [sql_view]
# DONE post-migration

---Fields in module 'auth_totp'---
auth_totp / res.users / totp_trusted_device_ids (one2many): relation is now 'auth_totp.device' ('res.users.apikeys') [nothing to do]
# NOTHING TO DO

---XML records in module 'auth_totp'---
NEW ir.model.access: auth_totp.access_auth_totp_device_access_employee
NEW ir.model.access: auth_totp.access_auth_totp_device_access_portal
NEW ir.rule: auth_totp.api_key_admin
NEW ir.rule: auth_totp.api_key_public
NEW ir.rule: auth_totp.api_key_user
NEW ir.ui.view: auth_totp.res_users_view_search
DEL ir.ui.view: auth_totp.assets_tests
DEL ir.ui.view: auth_totp.view_totp_list
# NOTHING TO DO