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

        <record id="account_report_general_ledger_view" model="ir.ui.view">
            <field name="name">General Ledger</field>
            <field name="model">account.report.general.ledger</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="account_common_report_view" />
            <field name="arch" type="xml">
            <data>
            <xpath expr="/form/label[@string='']" position="replace">
                <separator string="General Ledger" colspan="4"/>
                <label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your general ledger with details of all your account journals"/>
            </xpath>
            <xpath expr="//field[@name='target_move']" position="after">
                <field name="display_account"/>
                <field name="sortby"/>
                <field name="landscape"/>
                <field name="amount_currency"/>
                <newline/>
            </xpath>
            <xpath expr="//field[@name='filter']" position="after">
                <field name="initial_balance" attrs="{'readonly':[('filter', 'in', ('filter_no'))]}" />
            </xpath>
            </data>
            </field>
        </record>

        <record id="account_report_general_ledger_view_inherit" model="ir.ui.view">
            <field name="name">General Ledger</field>
            <field name="model">account.report.general.ledger</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="account_report_general_ledger_view" />
            <field name="arch" type="xml">
               <field name="fiscalyear_id" position="replace">
               <field name="fiscalyear_id" on_change="onchange_fiscalyear(fiscalyear_id)"/>
               </field>
            </field>
        </record>

        <record id="action_account_general_ledger_menu" model="ir.actions.act_window">  <!-- rename id -->
            <field name="name">General Ledger</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">account.report.general.ledger</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="account_report_general_ledger_view"/>
            <field name="target">new</field>
        </record>

        <record model="ir.values" id="action_account_general_ledger_values">
            <field name="model_id" ref="account.model_account_account" />
            <field name="object" eval="1" />
            <field name="name">General Ledger</field>
            <field name="key2">client_print_multi</field>
            <field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_general_ledger_menu'))" />
            <field name="key">action</field>
            <field name="model">account.account</field>
        </record>

        <menuitem
            icon="STOCK_PRINT"
            name="General Ledger"
            parent="account.final_accounting_reports"
            action="action_account_general_ledger_menu"
            groups="group_account_manager,group_account_user"
            id="menu_general_ledger"
           />

    </data>
</openerp>
