<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="view_account_payment_form_inherit" model="ir.ui.view">
        <field name="name">account.payment.form.inherit</field>
        <field name="model">account.payment</field>
        <field name="inherit_id" ref="account.view_account_payment_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='payment_method_code']" position="after">
                <field name="payment_token_id" options="{'no_create': True}"
                       attrs="{'invisible': [('payment_method_code', '!=', 'electronic')],
                               'required': [('payment_method_code', '=', 'electronic')]}"/>
            </xpath>
        </field>
    </record>
</odoo>