<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <!-- Account Cost Center views -->
    <record id="account_cost_center_view_form" model="ir.ui.view">
        <field name="model">account.cost.center</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <group>
                        <div class="oe_title">
                            <label for="name" />
                            <h1>
                                <field name="name" />
                            </h1>
                        </div>
                    </group>
                    <group name="main_group">
                        <group name="main_group1">
                            <field name="code" />
                        </group>
                        <group name="main_group2">
                            <field
                                name="company_id"
                                options="{'no_create': True}"
                                groups="base.group_multi_company"
                            />
                        </group>
                    </group>
                    <notebook name="notebook">
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>
    <record id="account_cost_center_view_tree" model="ir.ui.view">
        <field name="model">account.cost.center</field>
        <field name="arch" type="xml">
            <tree>
                <field name="code" />
                <field name="name" />
                <field name="company_id" groups="base.group_multi_company" />
            </tree>
        </field>
    </record>
    <record id="account_cost_center_view_search" model="ir.ui.view">
        <field name="model">account.cost.center</field>
        <field name="arch" type="xml">
            <search>
                <field
                    name="name"
                    string="Name/Code"
                    filter_domain="['|', ('code','ilike', self), ('name','ilike',self)]"
                />
            </search>
        </field>
    </record>
    <record id="account_cost_center_action" model="ir.actions.act_window">
        <field name="name">Cost Centers</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">account.cost.center</field>
        <field name="view_mode">tree,form</field>
        <field name="search_view_id" ref="account_cost_center_view_search" />
        <field name="help" type="html">
            <p class="oe_view_nocontent_create">
                Click to add a new cost center.
            </p>
            <p>
                Cost centers provide an extra analytic dimension
            </p>
        </field>
    </record>

    <!-- Account Cost Center menu-->
    <menuitem
        id="account_cost_center_menu"
        parent="account.menu_analytic_accounting"
        action="account_cost_center_action"
        groups="account.group_account_invoice"
        sequence="40"
    />

</odoo>
