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

    <record id="view_account_journal_form" model="ir.ui.view">
        <field name="name">account.journal.inherit.dashboard.kanban</field>
        <field name="model">account.journal</field>
        <field name="inherit_id" ref="account.view_account_journal_form" />
        <field name="arch" type="xml">
            <field name="suspense_account_id" position="before">
                <field
                    name="reconcile_mode"
                    attrs="{'required': [('type', 'in', ('bank', 'cash'))], 'invisible': [('type', 'not in', ('bank', 'cash'))]}"
                    options="{'no_quick_create': True}"
                    groups="account.group_account_readonly"
                />
                <field
                    name="reconcile_aggregate"
                    attrs="{'invisible': [('type','not in', ['bank', 'cash'])]}"
                    groups="account.group_account_readonly"
                />
            </field>
        </field>
    </record>
    <record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
        <field name="name">account.journal.inherit.dashboard.kanban</field>
        <field name="model">account.journal</field>
        <field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" />
        <field name="arch" type="xml">
            <xpath
                expr="//kanban/templates//div[@id='dashboard_bank_cash_left']/t[1]"
                position="before"
            >
                <t t-if="dashboard.number_to_reconcile > 0">
                    <button
                        type="action"
                        name="%(account_reconcile_oca.action_bank_statement_line_reconcile)s"
                        class="btn btn-primary"
                    > Reconcile <t
                            t-esc="dashboard.number_to_reconcile"
                        /> Items</button>
                </t>
            </xpath>
            <xpath
                expr="//kanban/templates//div[@id='dashboard_bank_cash_right']"
                position="inside"
            >
                <t t-if="dashboard.number_to_check > 0">
                    <div class="row">
                        <div class="col overflow-hidden text-left">
                            <a
                                type="action"
                                name="%(account_reconcile_oca.action_bank_statement_line_reconcile_to_check)s"
                            >
                                <t t-esc="dashboard.number_to_check" /> to check</a>
                        </div>
                        <div class="col-auto text-right">
                            <span>
                                <t t-esc="dashboard.to_check_balance" />
                            </span>
                        </div>
                    </div>
                </t>
            </xpath>

            <xpath expr="//div[@id='card_action_view_menus']" position="after">
                <div>
                    <a
                        role="menuitem"
                        type="action"
                        name="%(account_reconcile_oca.action_bank_statement_line_reconcile_all)s"
                    >Transactions</a>
                </div>
            </xpath>
        </field>
    </record>
</odoo>
