<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record model="ir.ui.view" id="view_product_adu_calculation_method_tree">
        <field name="name">product.adu.calculation.method.tree</field>
        <field name="model">product.adu.calculation.method</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name" />
                <field name="method" />
                <field name="company_id" groups="base.group_multi_company" />
            </tree>
        </field>
    </record>
    <record model="ir.ui.view" id="view_product_adu_calculation_method_form">
        <field name="name">product.adu.calculation.method.form</field>
        <field name="model">product.adu.calculation.method</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                <group name="name">
                    <field name="name" />
                    <field name="method" />
                    <field
                            name="company_id"
                            groups="base.group_multi_company"
                            widget="selection"
                        />
                </group>
                <group name="configuration">
                    <group name="past">
                        <field name="source_past" />
                        <label for="horizon_past" />
                        <div name="horizon_past">
                            <field name="horizon_past" class="oe_inline" /> days
                        </div>
                        <field
                                name="factor_past"
                                attrs="{'invisible': [('method', '!=', 'blended')]}"
                            />
                    </group>
                    <group name="future">
                        <field name="source_future" />
                        <label for="horizon_future" />
                        <div name="horizon_future">
                            <field name="horizon_future" class="oe_inline" /> days
                        </div>
                        <field
                                name="factor_future"
                                attrs="{'invisible': [('method', '!=', 'blended')]}"
                            />
                    </group>
                </group>
                </sheet>
            </form>
        </field>
    </record>
    <record id="view_product_adu_calculation_method_search" model="ir.ui.view">
        <field name="name">product.adu.calculation.method.search</field>
        <field name="model">product.adu.calculation.method</field>
        <field name="arch" type="xml">
            <search string="Search ADU Calculatiion methods">
                <field name="name" />
            </search>
        </field>
    </record>
    <record
        model="ir.actions.act_window"
        id="product_adu_calculation_method_form_action"
    >
        <field name="name">ADU calculation methods</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.adu.calculation.method</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="view_product_adu_calculation_method_search" />
    </record>
    <menuitem
        id="menu_product_adu_calculation_method"
        parent="ddmrp.menu_ddmrp_config"
        action="product_adu_calculation_method_form_action"
    />
</odoo>
