<?xml version="1.0"?>
<form string="Users">
                    <header>
                    </header>
                    <sheet>
                        <div class="oe_button_box" name="button_box">
                            <button name="action_show_groups" type="object" groups="base.group_no_one" class="oe_stat_button" icon="fa-users" help="Groups that apply to the current user">
                                <field string="Groups" name="groups_count" widget="statinfo"/>
                            </button>
                            <button name="action_show_accesses" type="object" groups="base.group_no_one" class="oe_stat_button" icon="fa-lock">
                                <field string="Access Rights" name="accesses_count" widget="statinfo"/>
                            </button>
                            <button name="action_show_rules" type="object" groups="base.group_no_one" class="oe_stat_button" icon="fa-lock">
                                <field string="Record Rules" name="rules_count" widget="statinfo"/>
                            </button>
                        </div>
                        <widget name="web_ribbon" title="External user" bg_color="text-bg-warning" invisible="not share"/>
                        <widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
                        <div class="alert alert-info text-center o_form_header" invisible="active and active_partner or not active and not active_partner or active and not active_partner" role="alert">
                          <a class="close" data-bs-dismiss="alert" href="#">x</a>
                          <div>
                            <strong>The contact linked to this user is still active</strong>
                          </div>
                          <div>You can archive the contact
                            <field name="partner_id" required="0" readonly="1"/>
                          </div>
                        </div>
                        <div class="d-flex gap-3">
                            <field name="image_1920" widget="contact_image" options="{'preview_image': 'avatar_128', 'size': [100,100], 'img_class': 'rounded-4'}"/>
                            <field name="avatar_128" invisible="1"/> <!-- Needed in contact_image widget -->
                            <div class="d-flex flex-column flex-grow-1">
                                <h1 class="mb-0 w-sm-75">
                                    <field name="name" placeholder="e.g. John Doe" required="1"/>
                                </h1>
                                <h3 class="d-flex align-items-baseline w-sm-50 mb-0">
                                    <field name="email" invisible="1"/> <!-- needed to update partner's email from on_change_login() -->
                                    <i class="fa fa-fw me-1 fa-envelope text-primary" title="Email"/>
                                    <field name="login" class="w-100" placeholder="Email"/>
                                </h3>
                                <h3 class="d-flex align-items-baseline w-sm-50 mb-0">
                                    <i class="fa fa-fw me-1 fa-phone text-primary" title="Phone"/>
                                    <field name="phone" class="w-100" widget="phone" placeholder="Phone"/>
                                </h3>
                            </div>
                        </div>
                        <group>
                            <field name="partner_id" groups="base.group_no_one" readonly="1" required="0" invisible="not id"/>
                        </group>
                        <notebook colspan="4">
                            <page name="access_rights" string="Access Rights">
                                <group string="Roles" invisible="share and companies_count &lt;= 1">
                                    <field name="role" invisible="share" widget="radio" options="{'horizontal': true}"/>
                                    <field string="Allowed Companies" name="company_ids" invisible="companies_count &lt;= 1" widget="many2many_tags" options="{'no_create': True, 'color_field': 'color'}"/>
                                    <field string="Default Company" name="company_id" invisible="companies_count &lt;= 1" context="{'user_preference': 0}"/>
                                </group>
                                <field name="group_ids" widget="res_user_group_ids" nolabel="1" colspan="2" groups="base.group_no_one"/>
                                <field name="group_ids" widget="res_user_group_ids" nolabel="1" colspan="2" groups="!base.group_no_one" invisible="share"/>
                            </page>
                            <page string="Preferences" name="preferences">
                                <group>
                                    <group string="Localization" name="preferences">
                                        <label for="lang"/>
                                        <div class="o_row">
                                            <field name="lang" required="1"/>
                                            <button type="action" name="44" class="oe_edit_only btn-sm btn-link mb4 fa fa-globe" aria-label="Add a language" title="Add a language"/>
                                        </div>
                                        <field name="tz" widget="timezone_mismatch" options="{'tz_offset_field': 'tz_offset'}"/>
                                        <field name="tz_offset" invisible="1"/> <!-- needed for the timezone_mismatch widget -->
                                    </group>
                                    <group string="Menus Customization" groups="base.group_no_one" invisible="share">
                                        <field name="action_id"/>
                                    </group>
                                </group>
                                <group name="messaging">
                                    <field name="signature" options="{'codeview': true}"/>
                                </group>
                            </page>
                            <page string="Account Security" name="account_security" invisible="not id"/>
                        </notebook>
                    </sheet>
                </form>
            