<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 Dixmit
     License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

    <record model="ir.ui.view" id="account_account_reconcile_form_view">
        <field
            name="name"
        >account.account.reconcile.form (in account_reconcile_oca)</field>
        <field name="model">account.account.reconcile</field>
        <field name="arch" type="xml">
            <form js_class="reconcile_manual" create="0">
                <field name="manual_delete" invisible="1" />
                <field name="manual_reference" invisible="1" />
                <field name="company_currency_id" invisible="1" />
                <field name="foreign_currency_id" invisible="1" />
                <field name="currency_id" invisible="1" />
                <div class="o_form_statusbar o_account_reconcile_oca_statusbar">
                    <div class="o_statusbar_buttons">
                        <button
                            name="reconcile"
                            type="object"
                            string="Reconcile"
                            class="btn btn-primary"
                            attrs="{'invisible': [('is_reconciled', '=', True)]}"
                        />
                        <button
                            name="clean_reconcile"
                            type="object"
                            string="Clean"
                            class="btn btn-secondary"
                            attrs="{'invisible': [('is_reconciled', '=', True)]}"
                        />
                    </div>
                </div>
                <field name="is_reconciled" invisible="1" />
                <group>
                    <group>
                    <field name="partner_id" />
                    </group>
                    <group>
                        <field name="account_id" />
                    </group>
                </group>
                <field
                    name="reconcile_data_info"
                    nolabel="1"
                    widget="account_reconcile_oca_data"
                    class="w-100"
                />
                <notebook>
                    <page
                        name="reconcile_line"
                        string="Reconcile"
                        attrs="{'invisible': [('is_reconciled', '=', True)]}"
                    >
                        <field
                            name="add_account_move_line_id"
                            widget="account_reconcile_oca_match"
                            domain="[('parent_state', '=', 'posted'), ('amount_residual', '!=', 0), ('account_id', '=', account_id)]"
                            context="{'search_default_partner_id': partner_id, 'tree_view_ref': 'account_reconcile_oca.account_move_line_tree_reconcile_view', 'search_view_ref': 'account_reconcile_oca.account_move_line_search_reconcile_view'}"
                        />
                    </page>
                </notebook>
            </form>
        </field>
    </record>

    <record model="ir.ui.view" id="account_account_reconcile_search_view">
        <field
            name="name"
        >account.account.reconcile.search (in account_reconcile_oca)</field>
        <field name="model">account.account.reconcile</field>
        <field name="arch" type="xml">
            <search>
                <field name="account_id" />
                <field name="partner_id" />
            </search>
        </field>
    </record>

    <record model="ir.ui.view" id="account_account_reconcile_tree_view">
        <field
            name="name"
        >account.account.reconcile.tree (in account_reconcile_oca)</field>
        <field name="model">account.account.reconcile</field>
        <field name="arch" type="xml">
            <tree>
                <!-- TODO -->
                <field name="id" />
                <field name="account_id" />
                <field name="partner_id" />
            </tree>
        </field>
    </record>

    <record model="ir.ui.view" id="account_account_reconcile_kanban_view">
        <field
            name="name"
        >account.account.reconcile.kanban (in account_reconcile_oca)</field>
        <field name="model">account.account.reconcile</field>
        <field name="arch" type="xml">
            <kanban js_class="reconcile">
                <templates>
                    <t t-name="kanban-box">
                        <div
                            t-attf-class="oe_kanban_card oe_kanban_global_click"
                            style="width:100%"
                        >
                            <div>
                                <field name="account_id" />
                            </div>
                            <div>
                                <field name="partner_id" />
                            </div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>

    <record model="ir.actions.act_window" id="account_account_reconcile_act_window">
        <field name="name">Reconcile</field>
        <field name="res_model">account.account.reconcile</field>
        <field name="view_mode">kanban</field>
        <field name="domain">[]</field>
        <field
            name="context"
        >{'view_ref': 'account_reconcile_oca.account_account_reconcile_form_view'}</field>
    </record>
    <record
        id="res_partner_account_account_reconcile_act_window"
        model="ir.actions.act_window"
    >
        <field name="name">Reconcile</field>
        <field name="res_model">account.account.reconcile</field>
        <field name="view_mode">kanban</field>
        <field name="domain">[("partner_id", "=", active_id)]</field>
        <field
            name="context"
        >{'view_ref': 'account_reconcile_oca.account_account_reconcile_form_view'}</field>
        <field name="binding_model_id" ref="base.model_res_partner" />
        <field name="binding_view_types">form</field>
    </record>

    <record
        id="account_account_account_account_reconcile_act_window"
        model="ir.actions.act_window"
    >
        <field name="name">Reconcile</field>
        <field name="res_model">account.account.reconcile</field>
        <field name="view_mode">kanban</field>
        <field name="domain">[("account_id", "=", active_id)]</field>
        <field
            name="context"
        >{'view_ref': 'account_reconcile_oca.account_account_reconcile_form_view'}</field>
        <field name="binding_model_id" ref="account.model_account_account" />
        <field name="binding_view_types">form</field>
    </record>

    <record model="ir.ui.menu" id="account_account_reconcile_menu">
        <field name="name">Reconcile</field>
        <field name="parent_id" ref="account.menu_finance_entries_actions" />
        <field name="action" ref="account_account_reconcile_act_window" />
        <field name="sequence" eval="10" />
    </record>

</odoo>
