<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- ============================================================ -->
    <!-- Salary Structure — Tree View                                 -->
    <!-- ============================================================ -->
    <record id="view_salary_structure_tree" model="ir.ui.view">
        <field name="name">c2c.salary.structure.tree</field>
        <field name="model">c2c.salary.structure</field>
        <field name="arch" type="xml">
            <tree string="Salary Structures">
                <field name="name"/>
                <field name="basic_percentage"/>
                <field name="hra_percentage"/>
                <field name="allowance_percentage"/>
                <field name="pf_percentage"/>
                <field name="esi_percentage"/>
                <field name="professional_tax_fixed"/>
                <field name="company_id" groups="base.group_multi_company"/>
            </tree>
        </field>
    </record>

    <!-- ============================================================ -->
    <!-- Salary Structure — Form View                                 -->
    <!-- ============================================================ -->
    <record id="view_salary_structure_form" model="ir.ui.view">
        <field name="name">c2c.salary.structure.form</field>
        <field name="model">c2c.salary.structure</field>
        <field name="arch" type="xml">
            <form string="Salary Structure">
                <sheet>
                    <div class="oe_title">
                        <label for="name"/>
                        <h1>
                            <field name="name" placeholder="e.g. Standard Structure"/>
                        </h1>
                    </div>
                    <group>
                        <group string="Earnings (%)">
                            <field name="basic_percentage"/>
                            <field name="hra_percentage"/>
                            <field name="allowance_percentage"/>
                        </group>
                        <group string="Deductions">
                            <field name="pf_percentage"/>
                            <field name="esi_percentage"/>
                            <field name="professional_tax_fixed"/>
                        </group>
                    </group>
                    <group>
                        <field name="company_id" groups="base.group_multi_company"/>
                        <field name="active" invisible="1"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <!-- ============================================================ -->
    <!-- Salary Structure — Action                                    -->
    <!-- ============================================================ -->
    <record id="action_salary_structure" model="ir.actions.act_window">
        <field name="name">Salary Structures</field>
        <field name="res_model">c2c.salary.structure</field>
        <field name="view_mode">tree,form</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Create your first Salary Structure
            </p>
            <p>
                Define how gross salary is split into Basic, HRA, and Allowances,
                and configure PF, ESI, and Professional Tax deduction rules.
            </p>
        </field>
    </record>
</odoo>
