<?xml version="1.0"?>
<form string="Payment Terms">
                    <sheet>
                        <field name="active" invisible="1"/>
                        <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
                        <group>
                            <group>
                                <field name="name"/>
                            </group>
                            <group>
                                <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
                            </group>
                        </group>
                        <group>
                            <field name="note" placeholder="Payment term explanation for the customer..."/>
                        </group>
                        <label for="display_on_invoice"/>
                        <field name="display_on_invoice"/>
                        <separator string="Terms"/>
                        <p class="text-muted">
                            The last line's computation type should be "Balance" to ensure that the whole amount will be allocated.
                        </p>
                        <field name="line_ids">
                            <tree string="Payment Terms" editable="top" no_open="True">
                                <field name="value" string="Due Type"/>
                                <field name="value_amount" attrs="{'invisible': [('value', '=', 'balance')]}"/>
                                <field name="months"/>
                                <field name="days"/>
                                <field name="end_month" widget="boolean_toggle" options="{'autosave': False}"/>
                                <field name="days_after" attrs="{'invisible': [('end_month','=', False)]}"/>
                                <field name="discount_percentage"/>
                                <field name="discount_days"/>
                            </tree>
                        </field>

                        <div class="oe_edit_only">
                            <separator string="Example"/>
                            <field name="example_invalid" invisible="1"/>
                            <div attrs="{'invisible': [('example_invalid', '=', False)]}">
                                The Payment Term must have one Balance line.
                            </div>
                            <div attrs="{'invisible': [('example_invalid', '=', True)]}" class="d-flex">
                                For any invoice of
                                <span class="mx-1"/> <field name="example_amount"/> <span class="mx-1"/>
                                dated
                                <span class="mx-1"/> <field name="example_date" class="oe_inline" style="color: #704A66; font-weight: bold"/>,
                                the due date(s) and amount(s) will be:
                            </div>
                            <field name="example_preview" attrs="{'invisible': [('example_invalid', '=', True)]}"/>
                        </div>
                    </sheet>
                </form>
            