<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="purchase_order_form" model="ir.ui.view">
        <field name="name">purchase.order.form</field>
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.purchase_order_form" />
        <field name="priority" eval="99" />
        <field name="arch" type="xml">
            <xpath
                expr="//field[@name='order_line']/tree/field[@name='qty_invoiced']"
                position="after"
            >
                <field
                    name="force_invoiced"
                    optional="show"
                    attrs="{'column_invisible': [('parent.state', 'not in', ['purchase', 'done'])], 'readonly': [('parent.state', 'not in', ['purchase', 'done'])]}"
                />
            </xpath>
        </field>
    </record>
</odoo>
