<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
     License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
    <record id="view_order_form" model="ir.ui.view">
        <field name="name">sale.order.form - ddmrp_exclude_moves_adu_calc_sales</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='order_line']/tree" position="inside">
                <field
                    name="exclude_from_adu"
                    optional="hide"
                    widget="boolean_toggle"
                    attrs="{'column_invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
                />
            </xpath>
        </field>
    </record>
</odoo>
