19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:28 +01:00
parent 20ddc1b4a3
commit c0efcc53f5
1162 changed files with 125577 additions and 105287 deletions

View file

@ -18,47 +18,34 @@
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='preferences']" position="after">
<page string="Account Security" name="security" attrs="{'invisible': [('id', '=', False)]}">
<xpath expr="//div[@name='auth']" position="after">
<div name="auth_2fa" class="d-flex mt-3">
<div class="col-7 col-sm-6 col-lg-3 d-flex flex-column">
<label for="totp_enabled" string="Two-factor Authentication" class="o_form_label"/>
<span class="text-muted">
Recommended for extra security.
</span>
</div>
<field name="totp_enabled" invisible="1"/>
<!-- For own user, allow to activate the two-factor Authentication -->
<div>
<div class="o_horizontal_separator d-flex align-items-center mt-2 mb-4 text-uppercase fw-bolder small">Two-factor Authentication
<div attrs="{'invisible': [('totp_enabled', '!=', False)]}">
<button attrs="{'invisible': &quot;[('id', '=', uid)]&quot;}" name="action_totp_enable_wizard"
disabled="1" type="object" class="fa fa-toggle-off o_auth_2fa_btn disabled" aria-label="Enable 2FA"></button>
<button attrs="{'invisible': &quot;[('id', '!=', uid)]&quot;}" name="action_totp_enable_wizard"
type="object" class="fa fa-toggle-off o_auth_2fa_btn disabled pe-auto" aria-label="Enable 2FA"></button>
</div>
<button attrs="{'invisible': [('totp_enabled', '=', False)]}" name="action_totp_disable" type="object"
class="fa fa-toggle-on o_auth_2fa_btn text-primary enabled" aria-label="Disable 2FA"></button>
</div>
<span attrs="{'invisible': [('totp_enabled', '!=', False)]}" class="text-muted">
Two-factor Authentication ("2FA") is a system of double authentication.
The first one is done with your password and the second one with a code you get from a dedicated mobile app.
Popular ones include Authy, Google Authenticator or the Microsoft Authenticator.
<a href="https://www.odoo.com/documentation/16.0/applications/general/auth/2fa.html" title="Learn More" target="_blank">
<i title="Documentation" class="fa fa-fw o_button_icon fa-info-circle"></i>
Learn More
</a>
</span>
<span attrs="{'invisible': [('totp_enabled', '=', False)]}" class="text-muted">This account is protected!</span>
</div>
<group name="auth_devices" string="Trusted Devices" attrs="{'invisible': [('totp_trusted_device_ids', '=', [])]}">
<div colspan="2">
<field name="totp_trusted_device_ids" nolabel="1" colspan="4" readonly="1">
<tree create="false" delete="false">
<field name="name" string="Device"/>
<field name="create_date" string="Added On"/>
<button type="object" name="remove"
title="Revoke" icon="fa-trash"/>
</tree>
</field>
<button name="revoke_all_devices" string="Revoke All" type="object" class="btn btn-secondary"
confirm="Are you sure? The user may be asked to enter two-factor codes again on those devices"/>
</div>
</group>
</page>
<button invisible="totp_enabled or id != uid" name="action_totp_enable_wizard"
type="object" class="btn btn-secondary h-100 my-auto" string="Enable 2FA"/>
<div invisible="totp_enabled or id == uid" name="div_action_totp_enable_wizard" class="h-100 d-flex flex-wrap align-items-center my-auto">
<i class="fa fa-remove text-danger"/>
<span class="fw-bold ms-1">
Disabled
</span>
</div>
<!-- Admin must be able to deactivate the 2FA, if the user is no longer able to use it. -->
<div invisible="not totp_enabled" class="h-100 d-flex flex-wrap align-items-center my-auto">
<i class="fa fa-check text-success"/>
<span class="fw-bold ms-1 me-2">
Enabled
</span>
<button name="action_totp_disable" type="object" class="btn btn-secondary h-100">
Disable
</button>
</div>
</div>
</xpath>
</field>
</record>
@ -68,41 +55,28 @@
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
<field name="arch" type="xml">
<group name="auth" position="after">
<field name="totp_enabled" invisible="1"/>
<div>
<div class="o_horizontal_separator mt-2 mb-4 text-uppercase fw-bolder small">Two-factor Authentication
<button attrs="{'invisible': [('totp_enabled', '!=', False)]}" name="action_totp_enable_wizard"
type="object" class="fa fa-toggle-off o_auth_2fa_btn" aria-label="Enable 2FA"/>
<button attrs="{'invisible': [('totp_enabled', '=', False)]}" name="action_totp_disable"
type="object" class="fa fa-toggle-on o_auth_2fa_btn text-primary" aria-label="Disable 2FA"/>
<xpath expr="//div[@name='auth']" position="after">
<div class="d-flex mt-3">
<div class="col-7 col-sm-6 col-lg-3 d-flex flex-column">
<label for="totp_enabled" string="Two-factor Authentication" class="o_form_label"/>
<span class="text-muted">
Recommended for extra security.
</span>
</div>
<field name="totp_enabled" invisible="1"/>
<button invisible="totp_enabled" name="action_totp_enable_wizard"
type="object" class="btn btn-secondary h-100 my-auto" string="Enable 2FA"/>
<div invisible="not totp_enabled" class="h-100 d-flex flex-wrap align-items-center my-auto">
<i class="fa fa-check text-success"/>
<span class="fw-bold ms-1 me-2">
Enabled
</span>
<button name="action_totp_disable" type="object" class="btn btn-secondary h-100">
Disable
</button>
</div>
<span attrs="{'invisible': [('totp_enabled', '=', False)]}" class="text-muted">Your account is protected!</span>
<span attrs="{'invisible': [('totp_enabled', '!=', False)]}" class="text-muted">
Two-factor Authentication ("2FA") is a system of double authentication.
The first one is done with your password and the second one with a code you get from a dedicated mobile app.
Popular ones include Authy, Google Authenticator or the Microsoft Authenticator.
<a href="https://www.odoo.com/documentation/16.0/applications/general/auth/2fa.html" title="Learn More" target="_blank">
<i title="Documentation" class="fa fa-fw o_button_icon fa-info-circle"></i>
Learn More
</a>
</span>
<group name="auth_devices" string="Trusted Devices" attrs="{'invisible': [('totp_trusted_device_ids', '=', [])]}">
<div colspan="2">
<field name="totp_trusted_device_ids" nolabel="1" colspan="4" readonly="1">
<tree create="false" delete="false">
<field name="name" string="Device"/>
<field name="create_date" string="Added On"/>
<button type="object" name="remove"
title="Revoke" icon="fa-trash"/>
</tree>
</field>
<button name="revoke_all_devices" string="Revoke All" type="object" class="btn btn-secondary"
confirm="Are you sure? You may be asked to enter two-factor codes again on those devices"/>
</div>
</group>
</div>
</group>
</xpath>
</field>
</record>
</odoo>