<?xml version="1.0"?>
<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
    <data>
        <menuitem
            name="Analytic"
            parent="account.menu_account_configuration"
            sequence="50"
            id="menu_analytic_account_configuration"/>

        <record model="ir.ui.view" id="account_view_form">
            <field name="model">analytic_account.account</field>
            <field name="type">form</field>
            <field name="name">account_form</field>
        </record>
        <record model="ir.ui.view" id="account_view_tree">
            <field name="model">analytic_account.account</field>
            <field name="type">tree</field>
            <field name="priority" eval="20"/>
            <field name="field_childs">childs</field>
            <field name="name">account_tree</field>
        </record>
        <record model="ir.ui.view" id="account_view_list">
            <field name="model">analytic_account.account</field>
            <field name="type">tree</field>
            <field name="priority" eval="10"/>
            <field name="name">account_list</field>
        </record>
        <record model="ir.ui.view" id="account_view_list2">
            <field name="model">analytic_account.account</field>
            <field name="type">tree</field>
            <field name="priority" eval="20"/>
            <field name="name">account_list2</field>
        </record>

        <record model="ir.action.act_window" id="act_account_tree">
            <field name="name">Accounts</field>
            <field name="res_model">analytic_account.account</field>
            <field name="domain"
                eval="[('parent', '=', None), ('type', '=', 'root')]"
                pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_account_tree_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="account_view_tree"/>
            <field name="act_window" ref="act_account_tree"/>
        </record>
        <record model="ir.action.act_window.view" id="act_account_tree_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="account_view_form"/>
            <field name="act_window" ref="act_account_tree"/>
        </record>
        <menuitem
            parent="menu_analytic_account_configuration"
            action="act_account_tree"
            sequence="10"
            id="menu_account_tree"/>

        <record model="ir.action.act_window" id="act_account_list">
            <field name="name">Accounts</field>
            <field name="res_model">analytic_account.account</field>
        </record>
        <record model="ir.action.act_window.view" id="act_account_list_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="account_view_list"/>
            <field name="act_window" ref="act_account_list"/>
        </record>
        <record model="ir.action.act_window.view" id="act_account_list_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="account_view_form"/>
            <field name="act_window" ref="act_account_list"/>
        </record>
        <menuitem
            parent="menu_account_tree"
            action="act_account_list"
            sequence="10"
            id="menu_account_list"/>

        <record model="ir.ui.view" id="account_view_tree_chart">
            <field name="model">analytic_account.account</field>
            <field name="type">tree</field>
            <field name="field_childs">childs</field>
            <field name="priority" eval="20"/>
            <field name="name">account_tree_chart</field>
        </record>
        <record model="ir.action.act_window" id="act_account_tree_chart">
            <field name="name">Chart of Analytic Accounts</field>
            <field name="res_model">analytic_account.account</field>
            <field name="context_model">analytic_account.account.context</field>
            <field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_account_tree_chart_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="account_view_tree_chart"/>
            <field name="act_window" ref="act_account_tree_chart"/>
        </record>
        <record model="ir.action.act_window.view" id="act_account_tree_chart_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="account_view_form"/>
            <field name="act_window" ref="act_account_tree_chart"/>
        </record>

        <menuitem
            parent="account.menu_reporting"
            action="act_account_tree_chart"
            sequence="30"
            id="menu_account_tree_chart"/>

        <record model="ir.rule.group" id="rule_group_account_companies">
            <field name="name">User in companies</field>
            <field name="model">analytic_account.account</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_account_companies">
            <field name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_account_companies"/>
        </record>

        <record model="ir.model.access" id="access_account">
            <field name="model">analytic_account.account</field>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_account_account_admin">
            <field name="model">analytic_account.account</field>
            <field name="group" ref="group_analytic_admin"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="True"/>
            <field name="perm_delete" eval="True"/>
        </record>

        <record model="ir.ui.view" id="account_distribution_view_form">
            <field name="model">analytic_account.account.distribution</field>
            <field name="type">form</field>
            <field name="name">account_distribution_form</field>
        </record>

        <record model="ir.ui.view" id="account_distribution_view_list">
            <field name="model">analytic_account.account.distribution</field>
            <field name="type">tree</field>
            <field name="name">account_distribution_list</field>
        </record>

        <record model="ir.model.access" id="access_account_distribution">
            <field name="model">analytic_account.account.distribution</field>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_account_distribution_account_admin">
            <field name="model">analytic_account.account.distribution</field>
            <field name="group" ref="group_analytic_admin"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="True"/>
            <field name="perm_delete" eval="True"/>
        </record>

        <record model="ir.ui.view" id="account_context_view_form">
            <field name="model">analytic_account.account.context</field>
            <field name="type">form</field>
            <field name="name">account_context_form</field>
        </record>

        <record model="ir.ui.view" id="analytic_account_entry_view_form">
            <field name="model">analytic.account.entry</field>
            <field name="type">form</field>
            <field name="name">analytic_account_entry_form</field>
        </record>
        <record model="ir.ui.view" id="analytic_account_entry_view_list">
            <field name="model">analytic.account.entry</field>
            <field name="type">tree</field>
            <field name="name">analytic_account_entry_tree</field>
        </record>

        <record model="ir.rule.group" id="rule_group_entry_companies">
            <field name="name">User in companies</field>
            <field name="model">analytic.account.entry</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_entry_companies">
            <field name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_entry_companies"/>
        </record>
    </data>
</tryton>
