ir_action_data.xml 1.1 KB

12345678910111213141516171819202122232425262728
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Invite to user 2FA -->
  4. <record model="ir.actions.server" id="action_invite_totp">
  5. <field name="name">Invite to use two-factor authentication</field>
  6. <field name="model_id" ref="base.model_res_users"/>
  7. <field name="binding_model_id" ref="base.model_res_users"/>
  8. <field name="binding_view_types">list</field>
  9. <field name="state">code</field>
  10. <field name="code">
  11. action = records.action_totp_invite()
  12. </field>
  13. <field name="groups_id" eval="[(4, ref('base.group_erp_manager'))]"/>
  14. </record>
  15. <!--Action called when using the link in "Invite to use 2FA" mail-->
  16. <record model="ir.actions.server" id="action_activate_two_factor_authentication">
  17. <field name="name">Open two-factor authentication configuration</field>
  18. <field name="model_id" ref="base.model_res_users"/>
  19. <field name="state">code</field>
  20. <field name="code">
  21. user = env.user
  22. action = user.action_open_my_account_settings()
  23. </field>
  24. <field name="groups_id" eval="[(4, ref('base.group_user'))]"/>
  25. </record>
  26. </odoo>