<?xml version="1.0"?>
<odoo>
    <record id="sale_order_form_quote" model="ir.ui.view">
        <field name="name">sale.order.form.payment</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">

            <xpath expr="//page/field[@name='order_line']/.." position="after">
                <page string="Optional Products">
                    <field name="sale_order_option_ids">
                        <tree string="Sales Quotation Template Lines" editable="bottom">
                            <control>
                                <create string="Add a product"/>
                            </control>
                            <field name="sequence" widget="handle"/>
                            <field name="product_id"/>
                            <field name="name"/>
                            <field name="quantity"/>
                            <field name="uom_id" groups="uom.group_uom"/>
                            <field name="price_unit"/>
                            <field name="discount" groups="sale.group_discount_per_so_line"/>
                            <button name="button_add_to_order" class="oe_link" icon="fa-shopping-cart" string="Add to order lines" type="object"/>
                        </tree>
                    </field>
                </page>
            </xpath>

            <xpath expr="//field[@name='partner_shipping_id']" position="after">
                <field name="sale_order_template_id" context="{'company_id': company_id}"
                    options="{'no_create': True, 'no_open': True}"
                    groups="sale_management.group_sale_order_template"
                />
            </xpath>

        </field>
    </record>

    <record id="sale.action_quotations" model="ir.actions.act_window">
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Create a new quotation, the first step of a new sale!
            </p>
            <p>
                Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
            </p>
        </field>
    </record>

    <menuitem id="menu_product_settings" name="Products" sequence="80"
        parent="sale.menu_sale_config"/>
    <menuitem id="menu_product_attribute_action"
        action="product.attribute_action"
        parent="menu_product_settings"  groups="product.group_product_variant" sequence="1"/>
    <menuitem id="menu_catalog_variants_action"
        action="product.variants_action"
        parent="menu_product_settings" groups="product.group_product_variant" sequence="2"/>
</odoo>
