<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2024 Akretion France (https://www.akretion.com)
  @author Alexis de Lattre <alexis.delattre@akretion.com>
  License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->

<odoo>

<record id="commission_profile_form" model="ir.ui.view">
    <field name="model">commission.profile</field>
    <field name="inherit_id" ref="commission_simple.commission_profile_form"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='assign_ids']/tree/field[@name='user_id']" position="after">
            <field name="agent_id" attrs="{'required': [('assign_type', '=', 'agent')], 'readonly': [('assign_type', '!=', 'agent')]}"/>
        </xpath>
    </field>
</record>


</odoo>
