Since 29db699e9b, auth_top depends of mail module, which lead to delay auth_totp
installation - not during DB creation anymore. As mail module is not installed
during DB creation, once an app that depends on mail is installed after DB
creation, auth_top module is finally installed and the session token now depends
auth_top module. As a result, the user is automatically logged out.
This commit moves the invite mail (and the dependance to 'mail' module) to a
new bridge module. Auth_totp module will now be reinstalled during DB creation
automatically.
Task-2638538
Parent Task-2487630
COM PR: odoo/odoo#76022
UPG PR: odoo/upgrade#2808
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
28 lines
1.1 KiB
XML
28 lines
1.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- Invite to user 2FA -->
|
|
<record model="ir.actions.server" id="action_invite_totp">
|
|
<field name="name">Invite to use two-factor authentication</field>
|
|
<field name="model_id" ref="base.model_res_users"/>
|
|
<field name="binding_model_id" ref="base.model_res_users"/>
|
|
<field name="binding_view_types">list</field>
|
|
<field name="state">code</field>
|
|
<field name="code">
|
|
action = records.action_totp_invite()
|
|
</field>
|
|
<field name="groups_id" eval="[(4, ref('base.group_erp_manager'))]"/>
|
|
</record>
|
|
|
|
<!--Action called when using the link in "Invite to use 2FA" mail-->
|
|
<record model="ir.actions.server" id="action_activate_two_factor_authentication">
|
|
<field name="name">Open two-factor authentication configuration</field>
|
|
<field name="model_id" ref="base.model_res_users"/>
|
|
<field name="state">code</field>
|
|
<field name="code">
|
|
user = env.user
|
|
action = user.action_open_my_account_settings()
|
|
</field>
|
|
<field name="groups_id" eval="[(4, ref('base.group_user'))]"/>
|
|
</record>
|
|
</odoo>
|