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

    <!-- Wizard form view -->
    <record id="view_account_move_rappel_wizard_form" model="ir.ui.view">
        <field name="name">account.move.rappel.wizard.form</field>
        <field name="model">account.move.rappel.wizard</field>
        <field name="arch" type="xml">
            <form string="Create Rappel Commission Invoice">
                <sheet>
                    <field name="company_id" invisible="1"/>
                    <group>
                        <group>
                            <field name="invoice_date"/>
                            <field name="journal_id"/>
                            <field name="product_id"/>
                        </group>
                        <group>
                            <field name="company_id" groups="base.group_multi_company"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Vendor Bills" name="vendor_bills">
                            <field name="move_ids">
                                <list string="Vendor Bills">
                                    <field name="name"/>
                                    <field name="move_type"
                                           widget="badge"
                                           decoration-info="move_type == 'in_invoice'"
                                           decoration-danger="move_type == 'in_refund'"/>
                                    <field name="partner_id"/>
                                    <field name="invoice_date"/>
                                    <field name="amount_untaxed"
                                           string="Taxable Base"/>
                                    <field name="rappel_pending"/>
                                </list>
                            </field>
                        </page>
                    </notebook>
                </sheet>
                <footer>
                    <button name="action_create_rappel_invoices"
                            type="object"
                            string="Create Rappel Invoice(s)"
                            class="btn-primary"/>
                    <button string="Cancel" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <!-- Action bound to the vendor bills list view (Action menu) -->
    <record id="action_open_rappel_wizard" model="ir.actions.act_window">
        <field name="name">Create Rappel Commission Invoice</field>
        <field name="res_model">account.move.rappel.wizard</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
        <field name="binding_model_id" ref="account.model_account_move"/>
        <field name="binding_view_types">list</field>
    </record>

</odoo>
