<?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>
        <record model="ir.ui.view" id="company_view_form">
            <field name="model">company.company</field>
            <field name="type">form</field>
            <field name="inherit" ref="party.party_view_form"/>
            <field name="arch" type="xml">
                <![CDATA[
                <data>
                    <xpath
                        expr="/form"
                        position="replace_attributes">
                        <form string="Company"/>
                    </xpath>
                    <xpath
                        expr="/form/label[@name=&quot;code&quot;]"
                        position="replace">
                        <label name="parent"/>
                    </xpath>
                    <xpath
                        expr="/form/field[@name=&quot;code&quot;]"
                        position="replace">
                        <field name="parent"/>
                    </xpath>
                    <xpath
                        expr="/form/group[@id=&quot;checkboxes&quot;]"
                        position="after">
                        <label name="currency"/>
                        <field name="currency"/>
                        <label name="vat_country"/>
                        <field name="vat_country"/>
                        <label name="vat_number"/>
                        <field name="vat_number"/>
                    </xpath>
                    <xpath
                        expr="/form/notebook/page[@id=&quot;general&quot;]"
                        position="after">
                        <page string="Employees" col="1" id="employees">
                            <field name="employees"/>
                        </page>
                        <page string="Reports" col="1" id="reports">
                            <separator name="header"/>
                            <field name="header"/>
                            <separator name="footer"/>
                            <field name="footer"/>
                        </page>
                    </xpath>
                </data>
                ]]>
            </field>
        </record>
        <record model="ir.ui.view" id="company_view_tree">
            <field name="model">company.company</field>
            <field name="type">tree</field>
            <field name="field_childs">childs</field>
            <field name="arch" type="xml">
                <![CDATA[
                <tree string="Companies">
                    <field name="name"/>
                    <field name="currency"/>
                    <field name="vat_code"/>
                    <field name="parent" tree_invisible="1"/>
                    <field name="childs" tree_invisible="1"/>
                </tree>
                ]]>
            </field>
        </record>
        <record model="ir.ui.view" id="company_view_list">
            <field name="model">company.company</field>
            <field name="type">tree</field>
            <field name="priority" eval="10"/>
            <field name="arch" type="xml">
                <![CDATA[
                <tree string="Companies">
                    <field name="name"/>
                </tree>
                ]]>
            </field>
        </record>
        <record model="ir.action.act_window" id="act_company_tree">
            <field name="name">Companies</field>
            <field name="res_model">company.company</field>
            <field name="domain">[('parent', '=', False)]</field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_company_tree_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="company_view_tree"/>
            <field name="act_window" ref="act_company_tree"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_company_tree_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="company_view_form"/>
            <field name="act_window" ref="act_company_tree"/>
        </record>
        <menuitem parent="party.menu_configuration" action="act_company_tree"
            id="menu_company_tree"/>

        <record model="ir.action.act_window" id="act_company_list">
            <field name="name">Companies</field>
            <field name="res_model">company.company</field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_company_list_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="company_view_list"/>
            <field name="act_window" ref="act_company_list"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_company_list_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="company_view_form"/>
            <field name="act_window" ref="act_company_list"/>
        </record>
        <menuitem parent="menu_company_tree" action="act_company_list"
            id="menu_company_list"/>

        <record model="ir.model.access" id="access_company">
            <field name="model" search="[('model', '=', 'company.company')]"/>
            <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_company_admin">
            <field name="model" search="[('model', '=', 'company.company')]"/>
            <field name="group" ref="party.group_party_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="user_view_form">
            <field name="model">res.user</field>
            <field name="inherit" ref="res.user_view_form"/>
            <field name="arch" type="xml">
                <![CDATA[
                    <data>
                        <xpath
                            expr="/form/notebook/page/separator[@name=&quot;signature&quot;]"
                            position="before">
                            <label name="main_company"/>
                            <field name="main_company" widget="selection"/>
                            <label name="company"/>
                            <field name="company" widget="selection"/>
                            <label name="employee"/>
                            <field name="employee"/>
                        </xpath>
                    </data>
                ]]>
            </field>
        </record>
        <record model="ir.ui.view" id="user_view_form_preferences">
            <field name="model">res.user</field>
            <field name="inherit" ref="res.user_view_form_preferences"/>
            <field name="arch" type="xml">
                <![CDATA[
                    <data>
                        <xpath
                            expr="/form/notebook/page/separator[@name=&quot;signature&quot;]"
                            position="before">
                            <label name="company"/>
                            <field name="company" widget="selection"/>
                        </xpath>
                    </data>
                ]]>
            </field>
        </record>
        <record model="ir.ui.view" id="property_view_form">
            <field name="model">ir.property</field>
            <field name="inherit" ref="ir.property_view_form"/>
            <field name="arch" type="xml">
                <![CDATA[
                    <data>
                        <xpath
                            expr="/form/field[@name=&quot;name&quot;]"
                            position="after">
                            <label name="company"/>
                            <field name="company" colspan="3"/>
                        </xpath>
                    </data>
                ]]>
            </field>
        </record>
        <record model="ir.ui.view" id="property_view_tree">
            <field name="model">ir.property</field>
            <field name="inherit" ref="ir.property_view_tree"/>
            <field name="arch" type="xml">
                <![CDATA[
                    <data>
                        <xpath
                            expr="/tree/field[@name=&quot;name&quot;]"
                            position="after">
                            <field name="company"/>
                        </xpath>
                    </data>
                ]]>
            </field>
        </record>

        <record model="ir.rule.group" id="rule_group_property">
            <field name="model" search="[('model', '=', 'ir.property')]"/>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_property1">
            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'ir.property')]"/>
            <field name="operator">=</field>
            <field name="operand">User/Current Company</field>
            <field name="rule_group" ref="rule_group_property"/>
        </record>
        <record model="ir.rule" id="rule_property2">
            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'ir.property')]"/>
            <field name="operator">=</field>
            <field name="operand">False</field>
            <field name="rule_group" ref="rule_group_property"/>
        </record>

        <record model="ir.ui.view" id="sequence_view_form">
            <field name="model">ir.sequence</field>
            <field name="inherit" ref="ir.sequence_view_form"/>
            <field name="arch" type="xml">
                <![CDATA[
                <data>
                    <xpath
                        expr="/form/field[@name=&quot;active&quot;]"
                        position="after">
                        <label name="company"/>
                        <field name="company" colspan="3"/>
                    </xpath>
                </data>
                ]]>
            </field>
        </record>
        <record model="ir.ui.view" id="sequence_view_tree">
            <field name="model">ir.sequence</field>
            <field name="inherit" ref="ir.sequence_view_tree"/>
            <field name="arch" type="xml">
                <![CDATA[
                <data>
                    <xpath
                        expr="/tree/field[@name=&quot;code&quot;]"
                        position="after">
                        <field name="company"/>
                    </xpath>
                </data>
                ]]>
            </field>
        </record>

        <record model="ir.rule.group" id="rule_group_sequence">
            <field name="model" search="[('model', '=', 'ir.sequence')]"/>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_sequence1">
            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'ir.sequence')]"/>
            <field name="operator">=</field>
            <field name="operand">User/Current Company</field>
            <field name="rule_group" ref="rule_group_sequence"/>
        </record>
        <record model="ir.rule" id="rule_sequence2">
            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'ir.sequence')]"/>
            <field name="operator">=</field>
            <field name="operand">False</field>
            <field name="rule_group" ref="rule_group_sequence"/>
        </record>

        <record model="ir.rule.group" id="rule_group_sequence_strict">
            <field name="model" search="[('model', '=', 'ir.sequence.strict')]"/>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_sequence_strict1">
            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'ir.sequence.strict')]"/>
            <field name="operator">=</field>
            <field name="operand">User/Current Company</field>
            <field name="rule_group" ref="rule_group_sequence_strict"/>
        </record>
        <record model="ir.rule" id="rule_sequence_strict2">
            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'ir.sequence.strict')]"/>
            <field name="operator">=</field>
            <field name="operand">False</field>
            <field name="rule_group" ref="rule_group_sequence_strict"/>
        </record>

        <record model="ir.ui.view" id="company_config_init_view_form">
            <field name="model">company.company.config.init</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <![CDATA[
                <form string="Create Company" col="2">
                    <image name="tryton-dialog-information" xexpand="0"
                        xfill="0"/>
                    <label string="You can now add your company into the system." id="add"
                        yalign="0.0" xalign="0.0" xexpand="1"/>
                </form>
                ]]>
            </field>
        </record>
        <record model="ir.module.module.config_wizard.item"
            id="config_wizard_item_company">
            <field name="name">company.company.config</field>
        </record>

        <record model="ir.ui.view" id="employee_view_form">
            <field name="model">company.employee</field>
            <field name="type">form</field>
            <field name="inherit" ref="party.party_view_form"/>
            <field name="arch" type="xml">
                <![CDATA[
                <data>
                    <xpath
                        expr="/form"
                        position="replace_attributes">
                        <form string="Employee"/>
                    </xpath>
                    <xpath
                        expr="/form/label[@name=&quot;code&quot;]"
                        position="replace">
                        <label name="company"/>
                    </xpath>
                    <xpath
                        expr="/form/field[@name=&quot;code&quot;]"
                        position="replace">
                        <field name="company"/>
                    </xpath>
                </data>
                ]]>
            </field>
        </record>
        <record model="ir.ui.view" id="employee_view_tree">
            <field name="model">company.employee</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <![CDATA[
                <tree string="Employees">
                    <field name="name"/>
                    <field name="company"/>
                </tree>
                ]]>
            </field>
        </record>

        <record model="ir.action.act_window" id="act_employee_form">
            <field name="name">Employees</field>
            <field name="res_model">company.employee</field>
        </record>
        <record model="ir.action.act_window.view" id="act_employee_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="employee_view_tree"/>
            <field name="act_window" ref="act_employee_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_employee_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="employee_view_form"/>
            <field name="act_window" ref="act_employee_form"/>
        </record>
        <menuitem parent="party.menu_configuration" action="act_employee_form"
            id="menu_employee_form"/>

        <record model="ir.model.access" id="access_employee">
            <field name="model" search="[('model', '=', 'company.employee')]"/>
            <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_employee_admin">
            <field name="model" search="[('model', '=', 'company.employee')]"/>
            <field name="group" ref="party.group_party_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.action.report" id="report_letter">
            <field name="name">Letter</field>
            <field name="model">party.party</field>
            <field name="report_name">party.letter</field>
            <field name="report">company/letter.odt</field>
            <field name="style">company/header_A4.odt</field>
        </record>
        <record model="ir.action.keyword" id="report_letter_party">
            <field name="keyword">form_print</field>
            <field name="model">party.party,-1</field>
            <field name="action" ref="report_letter"/>
        </record>
    </data>
</tryton>
