<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <!-- Inherit sale.order form — add WooCommerce tab -->
    <record id="sale_order_view_form_woo" model="ir.ui.view">
        <field name="name">sale.order.form.woo</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
            <xpath expr="//notebook" position="inside">
                <page string="WooCommerce" name="woocommerce"
                      invisible="woo_order_count == 0">
                    <field name="woo_bind_ids" readonly="1">
                        <list>
                            <field name="instance_id"/>
                            <field name="woo_order_number"/>
                            <field name="woo_status"/>
                            <field name="state" widget="badge"/>
                        </list>
                    </field>
                </page>
            </xpath>
        </field>
    </record>

</odoo>
