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

    <!-- Add RingCentral Authorization ID to user VoIP settings (admin view) -->
    <record id="res_users_form_inherit_rc" model="ir.ui.view">
        <field name="name">res.users.form.inherit.voip_ringcentral</field>
        <field name="model">res.users</field>
        <field name="inherit_id" ref="voip.res_user_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='voip_secret']" position="after">
                <field name="rc_authorization_id" readonly="1"
                       string="RC Auth ID"
                       invisible="not voip_provider_id"/>
            </xpath>
        </field>
    </record>

    <!-- Add to preferences form too -->
    <record id="res_users_prefs_form_inherit_rc" model="ir.ui.view">
        <field name="name">res.users.prefs.form.inherit.voip_ringcentral</field>
        <field name="model">res.users</field>
        <field name="inherit_id" ref="voip.res_users_view_form_preferences"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='voip_secret']" position="after">
                <field name="rc_authorization_id" readonly="1"
                       string="RC Auth ID"
                       invisible="not voip_provider_id"/>
            </xpath>
        </field>
    </record>

</odoo>
