<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="peppol_config_wizard_form" model="ir.ui.view">
        <field name="name">peppol.config.wizard.form</field>
        <field name="model">peppol.config.wizard</field>
        <field name="arch" type="xml">
            <form>
                <field name="company_id" invisible="1"/>
                <field name="account_peppol_edi_user" invisible="1"/>
                <div invisible="account_peppol_proxy_state != 'sender'">
                    You are sending your e-invoices via Odoo with this Peppol ID <field name="account_peppol_edi_identification" class="oe_inline o_form_label" readonly="1"/>.
                </div>
                <div invisible="account_peppol_proxy_state != 'smp_registration'">
                    Your Peppol registration is being processed, it should be active within a day.
                </div>
                <div invisible="account_peppol_proxy_state != 'receiver'">
                    You are sending and receiving your e-invoices via Odoo with this Peppol ID <field name="account_peppol_edi_identification" class="oe_inline o_form_label" readonly="1"/>.
                </div>
                <group string="Company information">
                    <label for="account_peppol_contact_email" class="text-nowrap"/>
                    <field name="account_peppol_contact_email"
                           nolabel="1"
                           required="account_peppol_proxy_state in ('sender', 'smp_registration', 'receiver')"/>
                </group>
                <group string="Danger zone" invisible="account_peppol_proxy_state not in ('sender', 'smp_registration', 'receiver')">
                    <button string="Remove from Peppol"
                            name="button_peppol_unregister"
                            type="object"
                            class="btn btn-danger text-nowrap"
                            confirm="This will delete your Peppol registration."/>
                    <button string="Enable reception"
                            name="button_peppol_register_sender_as_receiver"
                            type="object"
                            class="btn-secondary"
                            invisible="account_peppol_proxy_state != 'sender'"/>

                    <button string="Disable the reception."
                        name="button_peppol_reset_to_sender"
                        type="object"
                        class="btn-secondary"
                        invisible="account_peppol_proxy_state not in ('smp_registration', 'receiver')"/>
                </group>
                <footer>
                    <button string="Save" name="button_sync_form_with_peppol_proxy" type="object"
                            class="btn-primary" data-hotkey="q"/>
                    <button class="btn-secondary" special="cancel" data-hotkey="x"/>
                </footer>
            </form>
        </field>
    </record>
</odoo>
