<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_move_line_tree" model="ir.ui.view">
        <field name="model">account.move.line</field>
        <field name="inherit_id" ref="account.view_move_line_tree" />
        <field name="arch" type="xml">
            <field name="amount_currency" position="after">
                <field
                    name="amount_residual"
                    sum="Total Residual Amount"
                    optional="show"
                />
                <field
                    name="amount_residual_currency"
                    sum="Total Residual Amount in Currency"
                    groups="base.group_multi_currency"
                    optional="show"
                />
            </field>
        </field>
    </record>
    <record id="view_move_line_tree_grouped" model="ir.ui.view">
        <field name="model">account.move.line</field>
        <field name="inherit_id" ref="account.view_move_line_tree_grouped" />
        <field name="arch" type="xml">
            <field name="amount_currency" position="after">
                <field
                    name="amount_residual"
                    sum="Total Residual Amount"
                    optional="show"
                />
                <field
                    name="amount_residual_currency"
                    sum="Residual Amount in Currency"
                    groups="base.group_multi_currency"
                    optional="show"
                />
            </field>
        </field>
    </record>
    <!--  View to replace/extend unreconciled odoo filter  -->
    <record id="view_account_move_line_filter" model="ir.ui.view">
        <field name="model">account.move.line</field>
        <field name="inherit_id" ref="account.view_account_move_line_filter" />
        <field name="arch" type="xml">
            <filter name="unreconciled" position="attributes">
                <attribute
                    name="domain"
                >[('reconciled', '=', False), ('balance', '!=', 0), ('account_id.reconcile', '=', True)]</attribute>
            </filter>
            <filter name="unreconciled" position="after">
                <filter
                    name="partial_reconciled"
                    string="Partial reconciled"
                    domain="[('reconciled','=',False), '|', ('matched_credit_ids','!=',False), ('matched_debit_ids','!=',False)]"
                />
                <filter
                    name="reconciled"
                    string="Reconciled"
                    domain="[('reconciled','=',True)]"
                />
                <separator />
                <filter
                    name="not_full_reconciled"
                    string="Not Full Reconciled"
                    domain="[('full_reconcile_id','=',False), ('balance', '!=', 0), ('account_id.reconcile', '=', True)]"
                />
                <filter
                    name="full_reconciled"
                    string="Full reconciled"
                    domain="[('full_reconcile_id','!=',False)]"
                />
                <separator />
            </filter>
        </field>
    </record>
</odoo>
