<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <!--
        Country
        -->

        <record id="view_country_tree" model="ir.ui.view">
            <field name="name">res.country.tree</field>
            <field name="model">res.country</field>
            <field name="arch" type="xml">
                <tree string="Country">
                    <field name="name"/>
                    <field name="code"/>
                </tree>
            </field>
        </record>

        <record id="view_country_form" model="ir.ui.view">
            <field name="name">res.country.form</field>
            <field name="model">res.country</field>
            <field name="arch" type="xml">
                <form string="Country">
                    <field name="image" widget="image" class="oe_avatar"/>
                    <group>
                        <group>
                            <field name="name"/>
                            <field name="currency_id"/>
                        </group>
                        <group>
                            <field name="code"/>
                        </group>
                    </group>
                    <label for="address_format"/>
                    <field name="address_format" groups="base.group_no_one" placeholder="Address format..."/>
                </form>
            </field>
        </record>

        <record id="action_country" model="ir.actions.act_window">
            <field name="name">Countries</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">res.country</field>
            <field name="view_type">form</field>
            <field name="help">Display and manage the list of all countries that can be assigned to your partner records. You can create or delete countries to make sure the ones you are working on will be maintained.</field>
        </record>

        <menuitem id="menu_localisation" name="Localization" parent="menu_config_address_book" sequence="1" groups="base.group_no_one"/>

        <menuitem action="action_country" id="menu_country_partner" parent="menu_localisation" sequence="0" groups="base.group_no_one"/>

        <record id="view_country_group_tree" model="ir.ui.view">
            <field name="name">res.country.group.tree</field>
            <field name="model">res.country.group</field>
            <field name="arch" type="xml">
                <tree string="Country Group">
                    <field name="name"/>
                </tree>
            </field>
        </record>

        <record id="view_country_group_form" model="ir.ui.view">
            <field name="name">res.country.group.form</field>
            <field name="model">res.country.group</field>
            <field name="arch" type="xml">
                <form string="Country Group">
                    <field name="name"/>
                    <field name="country_ids" widget="many2many_tags"/>
                </form>
            </field>
        </record>

        <record id="action_country_group" model="ir.actions.act_window">
            <field name="name">Country Group</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">res.country.group</field>
            <field name="view_type">form</field>
            <field name="help">Display and manage the list of all countries group. You can create or delete country group to make sure the ones you are working on will be maintained.</field>
        </record>


        <menuitem action="action_country_group" id="menu_country_group" name="Country Group" parent="menu_localisation" sequence="1" groups="base.group_no_one"/>

        <!--
          State
        -->

        <record id="view_country_state_tree" model="ir.ui.view">
            <field name="name">res.country.state.tree</field>
            <field name="model">res.country.state</field>
            <field name="arch" type="xml">
                <tree string="State">
                    <field name="name"/>
                    <field name="code"/>
                    <field name="country_id"/>
                </tree>
            </field>
        </record>

        <record id="view_country_state_form" model="ir.ui.view">
            <field name="name">res.country.state.form</field>
            <field name="model">res.country.state</field>
            <field name="arch" type="xml">
                <form string="State">
                    <group>
                        <field name="name"/>
                        <field name="code"/>
                        <field name="country_id" options='{"no_open": True}'/>
                    </group>
                </form>
            </field>
        </record>

        <record id="action_country_state" model="ir.actions.act_window">
            <field name="name">Fed. States</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">res.country.state</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_country_state_tree"/>
            <field name="help">If you are working on the American market, you can manage the different federal states you are working on from here. Each state is attached to one country.</field>
        </record>

          <menuitem action="action_country_state" id="menu_country_state_partner" parent="menu_localisation" sequence="1" groups="base.group_no_one"/>

    </data>
</openerp>
