<?xml version="1.0" ?>
<openerp>
    <data>

        <!-- analytic_journal_rate_grid views -->
        <record model="ir.ui.view" id="analytic_journal_rate_grid_tree">
            <field name="name">analytic_journal_rate_grid.tree</field>
            <field name="model">analytic_journal_rate_grid</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Billing Rate per Journal for this Analytic Account" editable="bottom">
                    <field name="journal_id" required="1"/>
                    <field name="rate_id" />
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="analytic_journal_rate_grid_form">
            <field name="name">analytic_journal_rate_grid.form</field>
            <field name="model">analytic_journal_rate_grid</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Billing Rate per Journal for this Analytic Account" editable="bottom">
                    <field name="journal_id" required="1"/>
                    <field name="rate_id" />
                </form>
            </field>
        </record>

        <!-- account.analytic.account inherited view -->
        <record model="ir.ui.view" id="view_account_analytic_account_form_inherit">
            <field name="name">account.analytic.account.form</field>
            <field name="model">account.analytic.account</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="hr_timesheet_invoice.account_analytic_account_form_form"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='to_invoice']" position="after">
                    <field name="journal_rate_ids" colspan="4"/>
                </xpath>
            </field>
        </record>

        <!-- hr_timesheet_sheet.sheet inherited view -->
        <record model="ir.ui.view" id="hr_timesheet_sheet_form_inherit">
            <field name="name">hr.timesheet.sheet.form</field>
            <field name="model">hr_timesheet_sheet.sheet</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
            <field name="arch" type="xml">
                <xpath expr="/form/notebook/page/field[@name='timesheet_ids']/tree/field[@name='account_id']" position="replace">
                    <field name="account_id"  domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(account_id, user_id, unit_amount, journal_id)"/>
                </xpath>
            </field>
        </record>

        <!-- hr.analytic.timesheet inherited views -->
        <record model="ir.ui.view" id="hr_timesheet_line_form_inherit">
            <field name="name">hr.analytic.timesheet.form</field>
            <field name="model">hr.analytic.timesheet</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
            <field name="arch" type="xml">
                <xpath expr="/form/field[@name='account_id']" position="replace">
                    <field name="account_id"  domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(account_id, user_id, unit_amount, journal_id)" select="1"/>
                </xpath>
            </field>
        </record>

        <record model="ir.ui.view" id="hr_timesheet_line_form_inherit_2">
            <field name="name">hr.analytic.timesheet.form</field>
            <field name="model">hr.analytic.timesheet</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
            <field name="arch" type="xml">
                <xpath expr="/form/field[@name='journal_id']" position="replace">
                    <field name="journal_id" select="1" required="1" on_change="on_change_journal_id(journal_id, account_id)"/>
                </xpath>
            </field>
        </record>

    </data>
</openerp>
