<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- ============================================================ -->
    <!-- Module Category                                              -->
    <!-- ============================================================ -->
    <record id="module_category_c2c_payroll" model="ir.module.category">
        <field name="name">C2C Payroll</field>
        <field name="description">Access rights for C2C Payroll module.</field>
        <field name="sequence">30</field>
    </record>

    <!-- ============================================================ -->
    <!-- Security Groups                                              -->
    <!-- ============================================================ -->
    <record id="group_payroll_user" model="res.groups">
        <field name="name">Payroll User</field>
        <field name="category_id" ref="module_category_c2c_payroll"/>
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
    </record>

    <record id="group_payroll_manager" model="res.groups">
        <field name="name">Payroll Manager</field>
        <field name="category_id" ref="module_category_c2c_payroll"/>
        <field name="implied_ids" eval="[(4, ref('c2c_payroll.group_payroll_user'))]"/>
    </record>

    <!-- ============================================================ -->
    <!-- Record Rules — multi-company                                 -->
    <!-- ============================================================ -->
    <record id="rule_payslip_company" model="ir.rule">
        <field name="name">Payslip: multi-company</field>
        <field name="model_id" ref="model_c2c_payslip"/>
        <field name="domain_force">[('company_id', 'in', company_ids)]</field>
        <field name="groups" eval="[(4, ref('base.group_user'))]"/>
    </record>

    <record id="rule_salary_structure_company" model="ir.rule">
        <field name="name">Salary Structure: multi-company</field>
        <field name="model_id" ref="model_c2c_salary_structure"/>
        <field name="domain_force">[('company_id', 'in', company_ids)]</field>
        <field name="groups" eval="[(4, ref('base.group_user'))]"/>
    </record>
</odoo>
