<?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="arch" type="xml">
                <form string="Reconciliation" version="7.0">
                    <separator string="Reconciliation"/>
                    <label string="For an invoice to be considered as paid, the invoice entries must be reconciled with counterparts, usually payments. With the automatic reconciliation functionality, OpenERP makes its own search for entries to reconcile in a series of accounts. It finds entries for each partner where the amounts correspond."/>
                    <field name="account_ids" domain="[('reconcile','=',1)]"/>
                    <group col="4">
                        <field name="power"/>
                        <field name="allow_write_off"/>
                    </group>
                    <group col="4" attrs="{'readonly':[('allow_write_off', '!=', True)]}" string="Write-Off Move">
                        <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>
                    <footer>
                        <button name="reconcile" string="Reconcile" type="object" class="oe_highlight"/>
                        or
                        <button string="Cancel" class="oe_link" special="cancel"/>
                    </footer>
                </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">{}</field>
             <field name="target">new</field>
       </record>

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

        <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="arch" type="xml">
                <form string="Reconciliation Result" version="7.0">
                    <group>
                        <field name="reconciled"/>
                        <field name="unreconciled"/>
                    </group>
                    <footer>
                        <button string="Close" class="oe_highlight" special="cancel"/>
                    </footer>
                </form>
             </field>
         </record>

    </data>
</openerp>
