<?xml version="1.0" encoding="utf-8"?>
<odoo>
    
    <!-- Compatibility List View -->
    <record id="view_logistics_compatibility_tree" model="ir.ui.view">
        <field name="name">logistics.compatibility.tree</field>
        <field name="model">logistics.compatibility</field>
        <field name="arch" type="xml">
            <list>
                <field name="name"/>
                <field name="cargo_type"/>
                <field name="vehicle_type_id"/>
                <field name="container_type_id"/>
                <field name="active"/>
            </list>
        </field>
    </record>

    <!-- Compatibility Form View -->
    <record id="view_logistics_compatibility_form" model="ir.ui.view">
        <field name="name">logistics.compatibility.form</field>
        <field name="model">logistics.compatibility</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <div class="oe_title">
                        <h1>
                            <field name="name"/>
                        </h1>
                    </div>
                    
                    <group>
                        <group>
                            <field name="cargo_type"/>
                            <field name="vehicle_type_id"/>
                            <field name="container_type_id"/>
                            <field name="active"/>
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Compatibility Search View -->
    <record id="view_logistics_compatibility_search" model="ir.ui.view">
        <field name="name">logistics.compatibility.search</field>
        <field name="model">logistics.compatibility</field>
        <field name="arch" type="xml">
            <search>
                <field name="name"/>
                <field name="cargo_type"/>
                <field name="vehicle_type_id"/>
                <filter string="Active" name="active" domain="[('active','=',True)]"/>
                <filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
                <separator/>
                <group expand="0" string="Group By">
                    <filter string="Cargo Type" name="group_cargo_type" 
                            context="{'group_by':'cargo_type'}"/>
                    <filter string="Vehicle Type" name="group_vehicle_type" 
                            context="{'group_by':'vehicle_type_id'}"/>
                </group>
            </search>
        </field>
    </record>

    <!-- Compatibility Action -->
    <record id="action_logistics_compatibility" model="ir.actions.act_window">
        <field name="name">Compatibility Rules</field>
        <field name="res_model">logistics.compatibility</field>
        <field name="view_mode">list,form</field>
    </record>

</odoo>