<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018 Alex Comba - Agile Business Group
     Copyright 2016-2018 Akretion
     License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

    <record model="ir.ui.view" id="view_order_form">
        <field name="name">sale.order.form</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form" />
        <field name="arch" type="xml">
            <xpath expr="//div[@name='button_box']" position="inside">
                <button
                    type="object"
                    name="action_view_production"
                    class="oe_stat_button"
                    icon="fa-gears"
                    attrs="{'invisible': [('production_count', '=', 0)]}"
                >
                    <field
                        name="production_count"
                        widget="statinfo"
                        string="Production"
                    />
                </button>
            </xpath>
        </field>
    </record>

</odoo>
