<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Top-level app menu -->
    <menuitem id="menu_fusion_cp_root"
              name="Canada Post"
              web_icon="fusion_canada_post,static/description/icon.png"
              sequence="85"/>

    <!-- Shipments (parent — no action) -->
    <menuitem id="menu_fusion_cp_shipments"
              name="Shipments"
              parent="menu_fusion_cp_root"
              sequence="10"/>

    <!-- Shipments sub-menus -->
    <menuitem id="menu_fusion_cp_shipments_all"
              name="All Shipments"
              parent="menu_fusion_cp_shipments"
              action="action_fusion_cp_shipment"
              sequence="1"/>

    <menuitem id="menu_fusion_cp_shipments_confirmed"
              name="Confirmed"
              parent="menu_fusion_cp_shipments"
              action="action_fusion_cp_shipment_confirmed"
              sequence="10"/>

    <menuitem id="menu_fusion_cp_shipments_shipped"
              name="Shipped"
              parent="menu_fusion_cp_shipments"
              action="action_fusion_cp_shipment_shipped"
              sequence="20"/>

    <menuitem id="menu_fusion_cp_shipments_delivered"
              name="Delivered"
              parent="menu_fusion_cp_shipments"
              action="action_fusion_cp_shipment_delivered"
              sequence="30"/>

    <menuitem id="menu_fusion_cp_shipments_returned"
              name="Returned"
              parent="menu_fusion_cp_shipments"
              action="action_fusion_cp_shipment_returned"
              sequence="40"/>

    <!-- Configuration parent -->
    <menuitem id="menu_fusion_cp_config"
              name="Configuration"
              parent="menu_fusion_cp_root"
              sequence="90"/>

    <!-- Carrier Settings action -->
    <record id="action_fusion_cp_carrier_settings" model="ir.actions.act_window">
        <field name="name">Canada Post Carrier</field>
        <field name="res_model">delivery.carrier</field>
        <field name="view_mode">list,form</field>
        <field name="domain">[('delivery_type', '=', 'fusion_canada_post')]</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Configure your Canada Post carrier
            </p>
        </field>
    </record>

    <menuitem id="menu_fusion_cp_carrier"
              name="Carrier Settings"
              parent="menu_fusion_cp_config"
              action="action_fusion_cp_carrier_settings"
              sequence="10"/>
</odoo>
