<?xml version="1.0" encoding="utf-8"?>
<terp>
    <data>
        <record id="account_analytic_account_form_form" model="ir.ui.view">
            <field name="name">account.analytic.account.invoice.form</field>
            <field name="model">account.analytic.account</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="account.view_account_analytic_account_form"/>
            <field name="arch" type="xml">
                <field name="quantity_max" position="before">
                    <separator colspan="4" string="Invoicing Data"/>
                    <field name="pricelist_id"/>
                    <field name="to_invoice"/>
                    <field name="amount_max"/>
                    <field name="amount_invoiced"/>
                    <field name="state"/>
                </field>
            </field>
        </record>
        
        <record id="hr_timesheet_line_form" model="ir.ui.view">
            <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">
                <field name="journal_id" position="after">
                    <field name="to_invoice" select="2"/>
                    <field name="invoice_id"/>
                </field>
            </field>
        </record>
        
        <record id="hr_timesheet_line_form2" model="ir.ui.view">
            <field name="name">hr.analytic.timesheet.form2</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">
                <field name="account_id" position="replace">
                    <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)" select="1"/>
                </field>
            </field>
        </record>
        
        <record id="hr_timesheet_line_tree" model="ir.ui.view">
            <field name="name">hr.analytic.timesheet.tree</field>
            <field name="model">hr.analytic.timesheet</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
            <field name="arch" type="xml">
                <field name="amount" position="after">
                    <field name="to_invoice"/>
                </field>
            </field>
        </record>
        
        <record id="hr_timesheet_line_tree2" model="ir.ui.view">
            <field name="name">hr.analytic.timesheet.tree2</field>
            <field name="model">hr.analytic.timesheet</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
            <field name="arch" type="xml">
                
                <field name="account_id" position="replace">
                    <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
                </field>
            </field>
        </record>
        
        <!-- Inherits for account analytic lines -->
        
        <record id="view_account_analytic_line_tree_inherit" model="ir.ui.view">
            <field name="name">account.analytic.line.tree.to_invoice</field>
            <field name="model">account.analytic.line</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="account.view_account_analytic_line_tree"/>
            <field name="arch" type="xml">
                <field name="journal_id" position="after">
                    <field name="to_invoice"/>
                </field>
            </field>
        </record>
        
        <record id="view_account_analytic_line_form_inherit" model="ir.ui.view">
            <field name="name">account.analytic.line.form.to_invoice</field>
            <field name="model">account.analytic.line</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="account.view_account_analytic_line_form"/>
            <field name="arch" type="xml">
                <field name="product_uom_id" position="after">
                    <field name="to_invoice"/>
                </field>
            </field>
        </record>
        
        <!-- Menus -->
        <record id="action_hr_analytic_timesheet_open_tree" model="ir.actions.act_window">
            <field name="name">Entries to invoice</field>
            <field name="res_model">account.analytic.line</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('to_invoice','&lt;&gt;',False)]</field>
        </record>
        <menuitem action="action_hr_analytic_timesheet_open_tree" id="menu_hr_analytic_timesheet_tree" parent="account.menu_finance_periodical_processing"/>
         
        
        
        <record id="action_hr_analytic_timesheet_tree_invoiced" model="ir.actions.act_window">
            <field name="name">Uninvoiced Entries</field>
            <field name="res_model">account.analytic.line</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('invoice_id','=',False),('to_invoice','!=',False)]</field>
        </record>
        <menuitem action="action_hr_analytic_timesheet_tree_invoiced" id="menu_hr_analytic_timesheet_tree_invoiced" parent="hr_timesheet_invoice.menu_hr_analytic_timesheet_tree"/>
         
        
        
        <record id="action_hr_analytic_timesheet_tree_invoiced_my" model="ir.actions.act_window">
            <field name="name">My Uninvoiced Entries</field>
            <field name="res_model">account.analytic.line</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('invoice_id','=',False),('to_invoice','!=',False),('user_id','=',uid)]</field>
        </record>
        <menuitem action="action_hr_analytic_timesheet_tree_invoiced_my" id="menu_hr_analytic_timesheet_tree_invoiced_my" parent="hr_timesheet_invoice.menu_hr_analytic_timesheet_tree_invoiced"/>
         
        
        <record id="action_open_analytic_accounts" model="ir.actions.act_window">
            <field name="name">Open Analytic Accounts</field>
            <field name="res_model">account.analytic.account</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('state','&lt;&gt;','close'),('type','&lt;&gt;','view')]</field>
        </record>
        <menuitem action="action_open_analytic_accounts" id="menu_action_open_analytic_accounts" parent="account.account_analytic_def_chart"/>
         
        
        <record id="action_open_invoice_analytic_accounts" model="ir.actions.act_window">
            <field name="name">Unclosed Invoiceable Accounts</field>
            <field name="res_model">account.analytic.account</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('state','&lt;&gt;','close'),('type','&lt;&gt;','view'),('pricelist_id','&lt;&gt;',False)]</field>
        </record>
        <menuitem action="action_open_invoice_analytic_accounts" id="menu_action_open_invoice_analytic_accounts" parent="hr_timesheet_invoice.menu_action_open_analytic_accounts"/>
         
        
        
        <record id="action_draft_analytic_accounts" model="ir.actions.act_window">
            <field name="name">Draft Analytic Accounts</field>
            <field name="res_model">account.analytic.account</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('state','=','draft'),('type','&lt;&gt;','view')]</field>
        </record>
        <menuitem action="action_draft_analytic_accounts" id="menu_action_draft_analytic_accounts" parent="account.account_analytic_def_chart"/>
         
        
        
        <record id="action_pending_analytic_accounts" model="ir.actions.act_window">
            <field name="name">Pending Analytic Accounts</field>
            <field name="res_model">account.analytic.account</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('state','=','pending'),('type','&lt;&gt;','view')]</field>
        </record>
        <menuitem action="action_pending_analytic_accounts" id="menu_action_pending_analytic_accounts" parent="account.account_analytic_def_chart"/>
         
        
        
        
        
        <record id="view_hr_timesheet_invoice_factor_form" model="ir.ui.view">
            <field name="name">hr_timesheet_invoice.factor.form</field>
            <field name="model">hr_timesheet_invoice.factor</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Type of invoicing">
                    <field colspan="1" name="name" select="1"/>
                    <field colspan="1" name="customer_name" select="2"/>
                    <field colspan="2" name="factor"/>
                </form>
            </field>
        </record>
        <record id="view_hr_timesheet_invoice_factor_tree" model="ir.ui.view">
            <field name="name">hr_timesheet_invoice.factor.tree</field>
            <field name="model">hr_timesheet_invoice.factor</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Types of invoicing">
                    <field name="name"/>
                    <field name="customer_name"/>
                    <field name="factor"/>
                </tree>
            </field>
        </record>
        <record id="action_hr_timesheet_invoice_factor_form" model="ir.actions.act_window">
            <field name="name">Types of Invoicing</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">hr_timesheet_invoice.factor</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_hr_timesheet_invoice_factor_tree"/>
        </record>
        <menuitem action="action_hr_timesheet_invoice_factor_form" id="hr_timesheet_invoice_factor_view" parent="account.next_id_39"/>
        
    </data>
</terp>
