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

        <!--Account Moves-->
        <record id="validate_account_move_view" model="ir.ui.view">
            <field name="name">Validate Account Move</field>
            <field name="model">validate.account.move</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
            <form string="Validate Account Entries">
                <separator string="Validate Journal Entries of a Journal" colspan="4"/>
                <label string="All draft account entries in this journal and period will be validated. It means you won't be able to modify their accouting fields." colspan="4"/>
                <field name="journal_id"/>
                <newline/>
                <field name="period_id"/>
                <separator colspan="4"/>
                <group colspan="4" col="6">
                    <button icon="gtk-cancel" special="cancel" string="Cancel"/>
                    <button icon="terp-camera_test" string="Approve" name="validate_move" type="object"/>
               </group>
               </form>
            </field>
        </record>

        <record id="action_validate_account_move" model="ir.actions.act_window">
            <field name="name">Open Journal</field>
            <field name="res_model">validate.account.move</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="validate_account_move_view"/>
            <field name="target">new</field>
            <field name="help">The validation of journal entries process is also called 'ledger posting' and is the process of transferring debit and credit amounts from a journal of original entry to a ledger book.</field>
        </record>

        <menuitem
            name="Validate Journal Entries"
            parent="periodical_processing_journal_entries_validation"
            action="action_validate_account_move"
            id="menu_validate_account_moves"
           />

        <!--Account Move lines-->
        <record id="validate_account_move_line_view" model="ir.ui.view">
            <field name="name">Validate Journal Entries</field>
            <field name="model">validate.account.move.lines</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
            <form string="Validate Journal Entries">
                <separator string="Post Journal Entries" colspan="4"/>
                <image name="terp-referer"/>
                <label string="All selected journal entries will be validated and posted. It means you won't be able to modify their accouting fields." colspan="2"/>
                <separator colspan="4"/>
                <group colspan="4" col="6">
                    <button icon="gtk-cancel" special="cancel" string="Cancel"/>
                    <button icon="terp-camera_test" string="Approve" name="validate_move_lines" type="object" default_focus="1"/>
               </group>
            </form>
            </field>
        </record>

        <record id="action_validate_account_move_line" model="ir.actions.act_window">
            <field name="name">Validate Journal Entries</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">validate.account.move.lines</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="validate_account_move_line_view"/>
            <field name="context">{'record_id' : active_id}</field>
            <field name="target">new</field>
        </record>

        <record model="ir.values" id="validate_account_move_line_values">
            <field name="model_id" ref="account.model_account_move_line" />
            <field name="object" eval="1" />
            <field name="name">Validate Journal Entries</field>
            <field name="key2">client_action_multi</field>
            <field name="value" eval="'ir.actions.act_window,' + str(ref('action_validate_account_move_line'))" />
            <field name="key">action</field>
            <field name="model">account.move.line</field>
        </record>

    </data>
</openerp>
