<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <record id="account_automatic_reconcile_view" model="ir.ui.view">
             <field name="name">Account Automatic Reconcile</field>
             <field name="model">account.automatic.reconcile</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                <form string="Reconciliation">
                    <group width="660" height="430">
                        <separator string="Options" colspan="4"/>
                        <group>
                            <field name="account_ids" colspan="4" domain="[('reconcile','=',1)]"/>
                            <field name="date1"/>
                            <field name="date2"/>
                            <field name="power"/>
                            <field name="allow_write_off"/>
                        </group>
                        <newline/>
                        <group attrs="{'readonly':[('allow_write_off', '!=', True)]}">
                            <separator string="Write-Off Move" colspan="4"/>
                            <field name="max_amount"/>
                            <field name="writeoff_acc_id" attrs="{ 'required':[('allow_write_off', '=', True)]}"/>
                            <field name="journal_id" attrs="{ 'required':[('allow_write_off', '=', True)]}"/>
                            <field name="period_id" attrs="{ 'required':[('allow_write_off', '=', True)]}"/>
                        </group>
                        <separator string ="" colspan="4"/>
                        <group colspan="2" col="4">
                             <button special="cancel" string="Cancel" icon="gtk-cancel"/>
                            <button name="reconcile" string="Reconcile" type="object" icon="terp-stock_effects-object-colorize"/>
                         </group>
                    </group>
                </form>
             </field>
         </record>

        <record id="action_account_automatic_reconcile" model="ir.actions.act_window">
             <field name="name">Account Automatic Reconcile</field>
             <field name="res_model">account.automatic.reconcile</field>
             <field name="type">ir.actions.act_window</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
             <field name="view_id" ref="account_automatic_reconcile_view"/>
             <field name="context">{'record_id':active_id}</field>
             <field name="target">new</field>
             <field name="help">For an invoice to be considered as paid, the invoice entries must be reconciled with counterparts, usually payments. With the automatic reconciliation functionality, OpenERP make its own search for entries to reconcile in a series of accounts. It tries to find entries for each partner where the amounts correspond.</field>
       </record>

        <menuitem
            icon="STOCK_EXECUTE"
            name="Automatic Reconciliation"
            action="action_account_automatic_reconcile"
            id="menu_automatic_reconcile"
            parent="periodical_processing_reconciliation"
            groups="base.group_extended"/>

        <record id="account_automatic_reconcile_view1" model="ir.ui.view">
             <field name="name">Automatic reconcile unreconcile</field>
             <field name="model">account.automatic.reconcile</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                <form string="Reconciliation result">
                    <field name="reconciled"/>
                    <newline/>
                    <field name="unreconciled"/>
                    <group colspan="4" col="6">
                        <separator colspan="6"/>
                        <button special="cancel" string="Ok" icon="terp-dialog-close" default_focus="1"/>
                     </group>
                </form>
             </field>
         </record>

    </data>
</openerp>
