<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018-2019 ForgeFlow, S.L.
     License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
    <record id="view_purchase_request_line_make_purchase_order" model="ir.ui.view">
        <field name="name">Purchase Request Line Make Purchase Order</field>
        <field name="model">purchase.request.line.make.purchase.order</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Create RFQ">
                <separator string="Existing RFQ to update:" />
                <newline />
                <group>
                    <field
                        name="purchase_order_id"
                        domain="[('partner_id', '=', supplier_id)]"
                    />
                    <field name="sync_data_planned" />
                </group>
                <newline />
                <separator string="New PO details:" />
                <newline />
                <group>
                    <field name="supplier_id" />
                </group>
                <newline />
                <group>
                    <field name="item_ids" nolabel="1" colspan="2">
                        <tree name="Details" create="false" editable="bottom">
                            <field
                                name="line_id"
                                options="{'no_open': true}"
                                invisible="1"
                            />
                            <field name="request_id" attrs="{'readonly': True}" />
                            <field name="product_id" />
                            <field name="name" />
                            <field name="estimated_cost" />
                            <field name="product_qty" />
                            <field
                                name="product_uom_id"
                                invisible="1"
                                groups="!uom.group_uom"
                            />
                            <field name="product_uom_id" groups="uom.group_uom" />
                            <field
                                name="keep_description"
                                widget="boolean_toggle"
                                options="{'autosave': False}"
                            />
                            <field
                                name="keep_estimated_cost"
                                widget="boolean_toggle"
                                options="{'autosave': False}"
                            />
                        </tree>
                    </field>
                </group>
                <newline />
                <footer>
                    <button
                        name="make_purchase_order"
                        string="Create RFQ"
                        type="object"
                        class="oe_highlight"
                    />
                    <button special="cancel" string="Cancel" class="oe_link" />
                </footer>
            </form>
        </field>
    </record>
    <record
        id="action_purchase_request_line_make_purchase_order"
        model="ir.actions.act_window"
    >
        <field name="name">Create RFQ</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">purchase.request.line.make.purchase.order</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="view_purchase_request_line_make_purchase_order" />
        <field name="target">new</field>
        <field
            name="binding_model_id"
            ref="purchase_request.model_purchase_request_line"
        />
    </record>
</odoo>
