<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com)
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="mrp_planned_order_wizard_view_form" model="ir.ui.view">
        <field name="name">mrp.planned.order.wizard.form</field>
        <field name="model">mrp.planned.order.wizard</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <group name="dates">
                        <label for="date_start" string="Period" />
                        <div><field name="date_start" class="oe_inline" /> to <field
                                name="date_end"
                                class="oe_inline"
                            /></div>
                    </group>
                    <group>
                        <group name="attributes">
                            <field
                                name="date_range_type_id"
                                options="{'no_create': True}"
                            />
                        </group>
                    </group>
                    <div />
                    <group name="products" string="Products">
                        <field name="product_mrp_area_ids" nolabel="1">
                            <tree>
                                <field name="product_id" />
                                <field name="mrp_area_id" />
                                <field name="location_id" />
                                <field name="supply_method" />
                            </tree>
                        </field>
                    </group>
                    <footer>
                        <button
                            name="create_sheet"
                            string="Prepare"
                            type="object"
                            class="oe_highlight"
                        /> or
                        <button string="Cancel" class="oe_link" special="cancel" />
                    </footer>
                </sheet>
            </form>
        </field>
    </record>
    <record id="stock_mrp_planned_order_sheet_view_form" model="ir.ui.view">
        <field name="name">mrp.planned.order.sheet.form</field>
        <field name="model">mrp.planned.order.sheet</field>
        <field name="arch" type="xml">
            <form string="TEST DOS">
                <group name="dates">
                    <label for="date_start" string="Period" />
                    <div><field name="date_start" class="oe_inline" /> to <field
                            name="date_end"
                            class="oe_inline"
                        /></div>
                </group>
                <group>
                    <group name="attributes" colspan="2">
                        <field
                            name="date_range_type_id"
                            options="{'no_create': True}"
                        />
                    </group>
                </group>
                <div />
                <group name="mps_quantity" string="MPS quantity">
                    <field
                        name="line_ids"
                        nolabel="1"
                        widget="x2many_2d_matrix"
                        field_x_axis="value_x"
                        field_y_axis="value_y"
                        field_value="product_qty"
                        x_axis_clickable="0"
                        y_axis_clickable="0"
                    >
                        <tree editable="bottom">
                            <field name="value_x" />
                            <field name="value_y" />
                            <field name="product_qty" />
                        </tree>
                    </field>
                </group>
                <footer>
                    <button
                        name="button_validate"
                        type="object"
                        string="Validate"
                        class="oe_highlight"
                    />
                    <button class="oe_link" special="cancel" string="Cancel" />
                </footer>
            </form>
        </field>
    </record>

    <act_window id="action_mrp_planned_order_wizard"
        name="Create Fixed Planned Orders"
        res_model="mrp.planned.order.wizard"
        view_mode="form"
        view_type="form"
        target="new"
        groups="stock.group_stock_user"
    />
    <menuitem
        id="menu_stock_mrp_planned_order_wizard"
        parent="mrp.mrp_planning_menu_root"
        action="action_mrp_planned_order_wizard"
    />
</odoo>
