<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2015-2021 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_account_form" model="ir.ui.view">
    <field name="name">account.account.form</field>
    <field name="model">account.account</field>
    <field name="inherit_id" ref="account.view_account_form"/>
    <field name="arch" type="xml">
        <field name="deprecated" position="before">
            <field name="reconcile" attrs="{'invisible': ['|', ('internal_type','=','liquidity'), ('internal_group', '=', 'off_balance')]}"/>
        </field>
    </field>
</record>
 

<record id="view_account_search" model="ir.ui.view">
    <field name="name">account.account.search</field>
    <field name="model">account.account</field>
    <field name="inherit_id" ref="account.view_account_search"/>
    <field name="arch" type="xml">
        <!-- The native "name" filter uses a domain ['|', ('name','ilike',self), ('code','=like',str(self)+'%')]
        This is good because it uses '=like' on 'code', but sometimes there are digits in account names,
        so you get additionnal unexpected accounts in the result of the search -->
        <field name="name" position="after">
            <field name="code" filter_domain="[('code', '=like', str(self)+'%')]" string="Code"/>
        </field>
        <filter name="accounttype" position="after">
            <filter name="group_groupby" string="Group" context="{'group_by': 'group_id'}"/>
        </filter>
    </field>
</record>


</odoo>
