<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017 Jairo Llopis <jairo.llopis@tecnativa.com>
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="view_order_form" model="ir.ui.view">
        <field name="name">Recommended products button</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form" />
        <field name="arch" type="xml">
            <xpath expr="//form//header//button[@name='action_draft']" position="after">
                <button
                    name="%(sale_order_recommendation_action)d"
                    invisible="locked or state == 'cancel'"
                    string="Recommended Products"
                    type="action"
                />
            </xpath>
        </field>
    </record>
</odoo>
