<?xml version="1.0" encoding="utf-8" ?>
<!-- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="view_move_form" model="ir.ui.view">
        <field name="name">account.move.form</field>
        <field name="model">account.move</field>
        <field name="inherit_id" ref="account.view_move_form" />
        <field name="arch" type="xml">
            <field name="invoice_date" position="after">
                <field
                    name="invoice_date_due_payment_term"
                    string="Due Date"
                    groups="account_invoice_date_due.allow_to_change_due_date"
                    readonly="state not in ['posted', 'draft']"
                    invisible="state == 'draft' or not invoice_payment_term_id"
                />
            </field>
            <field name="invoice_date_due" position="attributes">
                <attribute
                    name="groups"
                >!account_invoice_date_due.allow_to_change_due_date</attribute>
            </field>
            <field name="invoice_date_due" position="after">
                <field
                    name="invoice_date_due"
                    groups="account_invoice_date_due.allow_to_change_due_date"
                    readonly="state not in ['posted', 'draft']"
                    invisible="invoice_payment_term_id"
                />
            </field>
        </field>
    </record>
</odoo>
