<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 Denis Mudarisov (IT-Projects LLC)
     License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). -->
<odoo>

<record id="action_user_log" model="ir.actions.act_window">
    <field name="name">Authentication logs</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">res.users.log</field>
    <field name="views">[[False, 'tree'], [False, 'form']]</field>
    <field name="domain">[('create_uid', '=', active_id)]</field>
    <field name="target">current</field>
    <field name="context">{'search_default_groupby_date': True}</field>
</record>

<record id="res_users_log_view_search" model="ir.ui.view">
    <field name="name">res.users.log.search</field>
    <field name="model">res.users.log</field>
    <field name="arch" type="xml">
        <search string="Test Search">
            <field name="create_uid" />
            <field name="create_date" />
                <group expand="0" string="Group By">
                    <filter
                        string="Date"
                        name="groupby_date"
                        context="{'group_by':'create_date:day'}"
                    />
                </group>
        </search>
    </field>
</record>

<record id="res_users_view_form" model="ir.ui.view">
    <field name="name">res.users.view.form</field>
    <field name="model">res.users</field>
    <field name="inherit_id" ref="base.view_users_form" />
    <field name="arch" type="xml">
        <xpath expr="//button[hasclass('oe_stat_button')]" position="after">
            <button
                    name="user_log_view.action_user_log"
                    type="action"
                    string="Authentication logs"
                    icon="fa-user-secret"
                />
        </xpath>
    </field>
</record>

<record id="res_users_log_view_tree" model="ir.ui.view">
    <field name="name">res.users.log.tree</field>
    <field name="model">res.users.log</field>
    <field name="arch" type="xml">
        <tree create="false" default_order="create_date desc">
            <field name="create_uid" />
            <field name="create_date" />
        </tree>
    </field>
</record>

<record id="res_users_log_view_form" model="ir.ui.view">
    <field name="name">res.users.log.form</field>
    <field name="model">res.users.log</field>
    <field name="arch" type="xml">
        <form create="false">
            <sheet>
                <group>
                    <field name="create_uid" />
                    <field name="create_date" />
                </group>
            </sheet>
        </form>
    </field>
</record>

</odoo>
