<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
     License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>

    <record id="view_ddmrp_flow_index_group_tree" model="ir.ui.view">
        <field name="name">ddmrp.flow.index.group.tree</field>
        <field name="model">ddmrp.flow.index.group</field>
        <field name="arch" type="xml">
            <tree>
                <field name="sequence" widget="handle" />
                <field name="name" />
                <field name="lower_range" />
                <field name="upper_range" />
            </tree>
        </field>
    </record>

    <record id="view_ddmrp_flow_index_group_form" model="ir.ui.view">
        <field name="name">ddmrp.flow.index.group.form</field>
        <field name="model">ddmrp.flow.index.group</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <widget
                        name="web_ribbon"
                        title="Archived"
                        bg_color="bg-danger"
                        attrs="{'invisible': [('active', '=', True)]}"
                    />
                    <group>
                        <group>
                            <field name="active" invisible="1" />
                            <field name="name" />
                            <field name="sequence" />
                            <field name="lower_range" />
                            <field name="upper_range" />
                        </group>
                    </group>
                    <field name="summary" placeholder="Log a description..." />
                </sheet>
            </form>
        </field>
    </record>

    <record id="view_ddmrp_flow_index_group_search" model="ir.ui.view">
        <field name="name">ddmrp.flow.index.group.search</field>
        <field name="model">ddmrp.flow.index.group</field>
        <field name="arch" type="xml">
            <search>
                <field name="name" />
                <separator />
                <filter
                    string="Archived"
                    name="inactive"
                    domain="[('active','=',False)]"
                />
            </search>
        </field>
    </record>

    <record id="action_ddmrp_flow_index_group" model="ir.actions.act_window">
        <field name="name">DDMRP Flow Index Group</field>
        <field name="res_model">ddmrp.flow.index.group</field>
        <field name="view_mode">tree,form</field>
    </record>

    <menuitem
        name="Flow Index Group"
        parent="ddmrp.menu_ddmrp_config"
        action="action_ddmrp_flow_index_group"
        id="menu_ddmrp_flow_index_group"
    />

</odoo>
