<?xml version="1.0" encoding="UTF-8" ?>
<!--
    Copyright 2018-2020 Brainbean Apps (https://brainbeanapps.com)
    License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>

    <record id="hr_timesheet_report_wizard_form" model="ir.ui.view">
        <field name="name">hr.timesheet.report.wizard.form</field>
        <field name="model">hr.timesheet.report.wizard</field>
        <field name="arch" type="xml">
            <form>
                <field name="has_line_ids" invisible="1" />
                <field name="line_ids" invisible="1" />
                <group
                    name="filter"
                    attrs="{'invisible': [('has_line_ids', '=', True)]}"
                >
                    <group name="left_filter">
                        <field name="date_from" />
                        <field name="project_ids" widget="many2many_tags" />
                        <field name="employee_ids" widget="many2many_tags" />
                        <field name="department_ids" widget="many2many_tags" />
                    </group>
                    <group name="right_filter">
                        <field name="date_to" />
                        <field name="task_ids" widget="many2many_tags" />
                        <field name="employee_category_ids" widget="many2many_tags" />
                    </group>
                </group>
                <group name="content">
                    <group>
                        <field name="grouping_field_ids">
                            <tree editable="bottom">
                                <field name="sequence" widget="handle" />
                                <field name="field_name" />
                            </tree>
                        </field>
                    </group>
                    <group>
                        <field name="entry_field_ids">
                            <tree editable="bottom">
                                <field name="sequence" widget="handle" />
                                <field name="field_name" />
                            </tree>
                        </field>
                    </group>
                </group>
                <group name="options">
                    <group>
                        <field name="time_format" widget="radio" />
                    </group>
                </group>
                <footer>
                    <button
                        name="action_export_html"
                        string="View"
                        type="object"
                        default_focus="1"
                        class="oe_highlight"
                    />
                    <button
                        name="action_export_pdf"
                        string="Export to PDF"
                        type="object"
                    />
                    <button
                        name="action_export_xlsx"
                        string="Export to XLSX"
                        type="object"
                    />
                    <button string="Cancel" class="btn-secondary" special="cancel" />
                </footer>
            </form>
        </field>
    </record>

    <record id="action_timesheet_report_wizard" model="ir.actions.act_window">
        <field name="name">Generate Timesheet Report</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">hr.timesheet.report.wizard</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>

    <menuitem
        id="menu_timesheet_report_wizard"
        parent="hr_timesheet.menu_timesheets_reports"
        action="action_timesheet_report_wizard"
        name="Timesheet Report Wizard"
        sequence="0"
    />

</odoo>
