<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="report_view" model="ir.ui.view">
        <field name="name">Sales Product Profit</field>
        <field name="model">sale.report.advance</field>
                <field name="arch" type="xml">
                    <form>
                        <group col="1">
                            <field name="from_date"/>
                            <field name="customer_ids" widget="many2many_tags" attrs="{'invisible': [('type', '=', 'product')]}"/>
                            <field name="type" widget="radio"></field>
                            <field name="company_ids" widget="many2many_tags"/>
                            <field name="product_ids" widget="many2many_tags" attrs="{'invisible': [('type', '=', 'customer')]}"/>
                        </group>
                        <group col="2">
                            <field name="to_date"/>
                        </group>
                        <footer>
                            <button name="get_report" string="PDF Report"
                                    type="object" class="btn-primary"/>
                            <button name="get_excel_report" string="XLSX Report"
                                    type="object" class="btn-primary"/>
                        </footer>
                    </form>
                </field>
    </record>
    <record id="sale_report_advance" model="ir.actions.act_window">
        <field name="name">Sale Report</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">sale.report.advance</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="report_view"/>
        <field name="target">new</field>
    </record>
</odoo>