<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_stock_buffer_profile_form" model="ir.ui.view">
        <field name="name">stock.buffer.profile.form</field>
        <field name="model">stock.buffer.profile</field>
        <field name="arch" type="xml">
            <form string="Buffer Profile">
                <sheet>
                    <div class="oe_edit_only">
                        <label for="name" class="oe_inline" />
                        <h1>
                        <field name="name" />
                        </h1>
                    </div>
                    <group>
                        <group name="replenish_method">
                            <field name="replenish_method" />
                        </group>
                        <group name="item_type">
                            <field name="item_type" />
                        </group>
                        <group name="lead_time">
                            <field name="lead_time_id" />
                        </group>
                        <group name="variability">
                            <field name="variability_id" />
                        </group>
                        <group name="organization">
                            <field
                                name="company_id"
                                groups="base.group_multi_company"
                                options="{'no_create': True}"
                            />
                        </group>
                        <group
                            name="distributed_options"
                            attrs="{'invisible': [('item_type', '!=', 'distributed')]}"
                        >
                            <field name="replenish_distributed_limit_to_free_qty" />
                            <field name="distributed_reschedule_max_proc_time" />
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>
    <record id="view_stock_buffer_profile_tree" model="ir.ui.view">
        <field name="name">stock.buffer.profile.tree</field>
        <field name="model">stock.buffer.profile</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name" />
                <field name="replenish_method" />
                <field name="item_type" />
                <field name="lead_time_id" />
                <field name="variability_id" />
                <field name="company_id" groups="base.group_multi_company" />
            </tree>
        </field>
    </record>
    <record id="view_stock_buffer_profile_search" model="ir.ui.view">
        <field name="name">stock.buffer.profile.search</field>
        <field name="model">stock.buffer.profile</field>
        <field name="arch" type="xml">
            <search string="Search Buffer Profiles">
                <field name="name" />
                <separator />
                <field name="item_type" />
                <field name="replenish_method" />
                <field name="lead_time_id" />
                <field name="variability_id" />
                <field name="company_id" groups="base.group_multi_company" />
            </search>
        </field>
    </record>
    <record id="stock_buffer_profile_form_action" model="ir.actions.act_window">
        <field name="name">Buffer Profiles</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">stock.buffer.profile</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="view_stock_buffer_profile_search" />
        <field name="help" type="html">
            <p class="oe_view_nocontent_create">
            Click to start a new buffer profile
          </p>
        </field>
    </record>
    <menuitem
        id="menu_ddmrp_config"
        name="DDMRP"
        parent="stock.menu_stock_config_settings"
    />
    <menuitem
        id="menu_stock_buffer_profile_mgt"
        parent="ddmrp.menu_ddmrp_config"
        action="stock_buffer_profile_form_action"
    />
</odoo>
