<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2024 Akretion France (http://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="view_move_form" model="ir.ui.view">
    <field name="name">agent.account.move.form</field>
    <field name="model">account.move</field>
    <field name="inherit_id" ref="account.view_move_form"/>
    <field name="arch" type="xml">
        <field name="invoice_user_id" position="after">
            <field name="invoice_agent_id"/>
        </field>
    </field>
</record>

<record id="view_invoice_tree" model="ir.ui.view">
    <field name="name">agent.account.move.tree</field>
    <field name="model">account.move</field>
    <field name="inherit_id" ref="account.view_invoice_tree"/>
    <field name="arch" type="xml">
        <field name="invoice_user_id" position="after">
            <field name="invoice_agent_id" optional="hide"/>
        </field>
    </field>
</record>

<record id="view_account_invoice_filter" model="ir.ui.view">
    <field name="name">agent.account.move.search</field>
    <field name="model">account.move</field>
    <field name="inherit_id" ref="account.view_account_invoice_filter"/>
    <field name="arch" type="xml">
        <field name="invoice_user_id" position="after">
            <field name="invoice_agent_id"/>
        </field>
        <filter name="salesperson" position="after">
            <filter name="invoice_agent_groupby" string="Agent" context="{'group_by': 'invoice_agent_id'}"/>
        </filter>
    </field>
</record>


</odoo>
