<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <!--
    ======================
    Languages
    ======================
    -->
        <menuitem id="next_id_2" name="User Interface" parent="base.menu_custom" groups="base.group_extended"/>

        <!--
    ======================
    Groups
    ======================
    -->
        <record id="view_groups_form" model="ir.ui.view">
            <field name="name">res.groups.form</field>
            <field name="model">res.groups</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Groups">
                    <field name="name" select="1"/>
                    <notebook colspan="4">
                        <page string="Users">
                            <field colspan="4" name="users" nolabel="1"/>
                        </page>
                        <page string="Inherited">
                            <label colspan="4" string="Users added to this group are automatically added in the following groups."/>
                            <field colspan="4" name="implied_ids" nolabel="1"/>
                        </page>
                        <page string="Menus">
                            <field colspan="4" name="menu_access" nolabel="1"/>
                        </page>
                        <page string="Access Rights">
                            <field colspan="4" name="model_access" nolabel="1">
                                <tree string="Access Rules" editable="top">
                                    <field name="model_id"/>
                                    <field name="perm_read"/>
                                    <field name="perm_write"/>
                                    <field name="perm_create"/>
                                    <field name="perm_unlink"/>
                                    <field name="name"/>
                                </tree>
                                <form string="Access Controls">
                                    <field colspan="4" name="name" select="1"/>
                                    <field name="model_id" select="1"/>
                                    <newline/>
                                    <field name="perm_read"/>
                                    <field name="perm_write"/>
                                    <field name="perm_create"/>
                                    <field name="perm_unlink"/>
                                </form>
                            </field>
                        </page>
                        <page string="Rules">
                            <field colspan="4" name="rule_groups" nolabel="1">
                                <tree string="Rules">
                                    <field name="name"/>
                                    <field name="model_id"/>
                                    <field name="global"/>
                                </tree>
                            </field>
                        </page><page string="Notes">
                            <field colspan="4" name="comment" nolabel="1"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>

        <!--
    ======================
    Users
    ======================
    -->

        <record id="view_users_form_simple_modif" model="ir.ui.view">
            <field name="name">res.users.form.modif</field>
            <field name="model">res.users</field>
            <field name="type">form</field>
            <field eval="18" name="priority"/>
            <field name="arch" type="xml">
                <form string="Users">
                    <field name="name"/>
                    <newline/>
                    <group colspan="2" col="2">
                        <separator string="Preferences" colspan="2"/>
                        <field name="view"/>
                        <field name="context_lang"/>
                        <field name="context_tz"/>
                        <field name="menu_tips"/>
                    </group>
                    <group name="default_filters" colspan="2" col="2">
                        <separator string="Default Filters" colspan="2"/>
                        <field name="company_id" widget="selection"
                            groups="base.group_multi_company" on_change="on_change_company_id(company_id)"/>
                    </group>
                    <separator string="Email Preferences" colspan="4"/>
                    <field colspan="4" name="user_email" widget="email"/>
                    <field colspan="4" name="signature"/>
                </form>
            </field>
        </record>

        <record id="view_users_form" model="ir.ui.view">
            <field name="name">res.users.form</field>
            <field name="model">res.users</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Users">
                    <group colspan="4" col="6">
                        <field name="name" select="1"/>
                        <field name="login" select="1"/>
                        <field name="id" invisible="1"/>
                        <field name="new_password" password="True" attrs="{'required': [('id','=',False)]}"/>
                        <field name="active"/>
                    </group>
                    <notebook colspan="4">
                        <page string="User">
                          <group colspan="4" col="6">
                            <!-- Second nested group to avoid misalignment with email prefs groups
                                 in simplified view -->
                            <group colspan="6" col="6">
                                <group col="2" colspan="2">
                                    <separator string="Preferences" colspan="2"/>
                                    <field name="context_lang"/>
                                    <field name="context_tz"/>
                                    <field name="menu_tips"/>
                                </group>
                                <group name="default_filters" colspan="2" col="2">
                                    <separator string="Default Filters" colspan="2"/>
                                    <field name="company_id" required="1" context="{'user_preference': 0}" groups="base.group_multi_company"/>
                                </group>
                                <group colspan="2" col="2" groups="base.group_extended">
                                    <separator string="Action" colspan="2"/>
                                    <field name="action_id"/>
                                    <field domain="[('usage','=','menu')]" name="menu_id" required="True"/>
                                </group>
                            </group>
                            <group colspan="6" col="2">
                                <separator string="Email Preferences" colspan="2"/>
                                <field name="user_email" widget="email"/>
                                <field name="signature"/>
                            </group>
                          </group>
                        </page>
                        <page string="Access Rights">
                            <field nolabel="1" name="groups_id"/>
                        </page>
                        <page string="Companies" groups="base.group_multi_company">
                            <field colspan="4" nolabel="1" name="company_ids" select="1"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="view_users_tree" model="ir.ui.view">
            <field name="name">res.users.tree</field>
            <field name="model">res.users</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Users">
                    <field name="name"/>
                    <field name="login"/>
                    <field name="context_lang"/>
                    <field name="date"/>
                </tree>
            </field>
        </record>

        <record id="view_users_search" model="ir.ui.view">
            <field name="name">res.users.search</field>
            <field name="model">res.users</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Users">
                    <field name="name"/>
                    <field name="login"/>
                    <field name="company_ids" string="Company" groups="base.group_multi_company"/>
                </search>
            </field>
        </record>

        <!--
    ======================
    Company
    ======================
    -->

        <report id="preview_report" model="res.company" name="preview.report" multi="True"
            rml="base/report/preview_report.rml" string="Preview Report"/>

        <record id="bank_account_update" model="ir.actions.act_window">
            <field name="name">Company Bank Accounts</field>
            <field name="res_model">res.partner.bank</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="context" eval="{'default_partner_id':ref('base.main_partner'), 'company_hide':False, 'default_company_id':ref('base.main_company'), 'search_default_my_bank':1}"/>
        <field name="help">Configure your company's bank account and select those that must appear on the report footer. You can drag &amp; drop bank in the list view to reorder bank accounts. If you use the accounting application of OpenERP, journals and accounts will be created automatically based on these data.</field>
        </record>


        <record id="view_company_form" model="ir.ui.view">
            <field name="name">res.company.form</field>
            <field name="model">res.company</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Company">
                    <group colspan="4" col="6">
                        <group colspan="4" col="4">
                            <field name="name"/>
                            <field name="partner_id" readonly="1" required="0"/>
                            <field name="parent_id"  groups="base.group_multi_company"/>
                        </group>
                        <group colspan="2" col="2">
                            <field name="logo" nolabel="1" widget="image"/>
                        </group>
                    </group>
                    <notebook colspan="4">
                        <page string="General Information">
                            <separator string="Address Information" colspan="4"/>
                            <field name="street"/>
                            <field name="street2"/>
                            <field name="zip"/>
                            <field name="city"/>
                            <field name="country_id"/>
                            <field name="state_id"/>
                            <field name="phone"/>
                            <field name="email"/>
                            <field name="fax"/>
                            <field name="website"/>
                            <field name="vat"/>
                            <field name="company_registry"/>
                            <separator string="Header/Footer of Reports" colspan="4"/>
                            <group colspan="4" col="3">
                                <field name="rml_header1" colspan="3"/>
                                <newline/>
                                <field name="rml_footer1" colspan="2"/>
                                <button name="generate_header" string="Generate" type="object" icon="gtk-go-forward"/>
                                <newline/>
                                <field name="rml_footer2" colspan="2"/>
                                <button name="%(bank_account_update)d" string="Set Bank Accounts" type="action" icon="gtk-go-forward"/>
                                <newline/>
                                <label string="" colspan="2"/>
                                <button name="%(preview_report)d" string="Preview Header" type="action" icon="gtk-print"/>
                            </group>
                        </page>
                        <page string="External Template" groups="base.group_extended">
                            <field colspan="4" name="rml_header" nolabel="1"/>
                        </page>
                        <page string="Internal Template" groups="base.group_extended">
                            <separator string="Portrait" colspan="2"/>
                            <separator string="Landscape" colspan="2"/>
                            <field colspan="2" name="rml_header2" nolabel="1"/>
                            <field colspan="2" name="rml_header3" nolabel="1"/>
                        </page>
                        <page string="Configuration">
                            <separator string="Accounting" colspan="4"/>
                            <field name="currency_id" colspan="2"/>
                            <newline/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="view_company_tree" model="ir.ui.view">
            <field name="name">res.company.tree</field>
            <field name="model">res.company</field>
            <field name="type">tree</field>
            <field name="field_parent">child_ids</field>
            <field name="arch" type="xml">
                <tree string="Companies">
                    <field name="name"/>
                    <field name="partner_id"/>
                </tree>
            </field>
        </record>
        
        <record id="category_administration_config" model="ir.actions.todo.category">
            <field name="name">Administration</field>
            <field name="sequence">1</field>
        </record>
    </data>
</openerp>
