<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="auth_partner_view_tree" model="ir.ui.view">
        <field name="model">auth.partner</field>
        <field name="arch" type="xml">
            <tree>
                <field name="directory_id" />
                <field name="partner_id" />
                <field name="login" />
                <field name="mail_verified" />
                <field name="nbr_pending_reset_sent" />
                <field name="date_last_request_reset_pwd" />
                <field name="date_last_sucessfull_reset_pwd" />
            </tree>
        </field>
    </record>

    <record id="auth_partner_view_form" model="ir.ui.view">
        <field name="model">auth.partner</field>
        <field name="arch" type="xml">
            <form string="Auth Partner">
                <header>
                    <button name="send_invite" type="object" string="Send Invite" />
                    <button
                        name="impersonate"
                        type="object"
                        string="Impersonate"
                        class="btn-info"
                        attrs="{'invisible': [('user_can_impersonate', '=', False)]}"
                    />
                    <button
                        name="%(auth_partner_force_set_password_action)d"
                        type="action"
                        string="Set Password"
                        class="btn-secondary"
                        groups="auth_partner.group_auth_partner_manager"
                    />
                </header>
                <sheet>
                    <div class="oe_title">
                        <h1>
                            <field name="user_can_impersonate" invisible="1" />
                            <field name="partner_id" />
                        </h1>
                    </div>
                    <group>
                        <field name="login" />
                        <field name="directory_id" />
                    </group>
                    <group>
                        <field name="mail_verified" />
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record id="auth_partner_view_search" model="ir.ui.view">
        <field name="model">auth.partner</field>
        <field name="arch" type="xml">
            <search string="Auth Partner">
                <field name="directory_id" />
                <field name="partner_id" />
                <group expand="0" string="Group By">
                    <filter
                        string="Directory"
                        name="directory"
                        domain="[]"
                        context="{'group_by':'directory_id'}"
                    />
                </group>
            </search>
        </field>
    </record>

    <record id="auth_partner_action" model="ir.actions.act_window">
        <field name="name">Partner</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">auth.partner</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="auth_partner_view_search" />
        <field name="domain">[]</field>
        <field name="context">{}</field>
    </record>

    <menuitem
        id="auth"
        parent="base.menu_custom"
        sequence="100"
        name="Partner Authentication"
    />
    <menuitem
        id="auth_partner_menu"
        parent="auth"
        sequence="10"
        action="auth_partner_action"
    />
</odoo>
