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

        <record id="maintenance_contract_tree_view" model="ir.ui.view">
            <field name="name">maintenance.contract.tree</field>
            <field name="model">maintenance.contract</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Maintenance Contract">
                    <field name="name"/>
                    <field name="date_start"/>
                    <field name="date_stop"/>
                    <field name="state" />
                </tree>
            </field>
        </record>

        <record id="maintenance_contract_form_view" model="ir.ui.view">
            <field name="name">maintenance.contract.form</field>
            <field name="model">maintenance.contract</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Maintenance Contract">
                    <separator string="Information" colspan="4"/>
                    <field name="name"/>
                    <newline/>
                    <field name="date_start"/>
                    <field name="date_stop"/>
                    <separator string="Covered Modules" colspan="4"/>
                    <field name="module_ids" nolabel="1" colspan="4">
                        <tree string="Covered Modules">
                            <field name="name" />
                            <field name="version" />
                        </tree>
                    </field>
                    <field name="state" colspan="4"/>
                </form>
            </field>
        </record>

        <record id="maintenance_contract_search_view" model="ir.ui.view">
            <field name="name">maintenance.contract.search</field>
            <field name="model">maintenance.contract</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Maintenance Contract">
                    <field name="name"/>
                    <field name="date_start"/>
                    <field name="date_stop"/>
                </search>
            </field>
        </record>

        <record id="maintenance_contract_view_calendar" model="ir.ui.view">
            <field name="name">maintenance.contract.calendar</field>
            <field name="model">maintenance.contract</field>
            <field name="type">calendar</field>
            <field name="arch" type="xml">
                <calendar string="Maintenance Contract" date_start="date_start" color="state">
                    <field name="name"/>
                    <field name="state"/>
                </calendar>
            </field>
        </record>

        <record id="action_maintenance_contract_form" model="ir.actions.act_window">
            <field name="name">Maintenance Contracts</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">maintenance.contract</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form,calendar</field>
            <field name="search_view_id" ref="maintenance_contract_search_view"/>
        </record>

        <menuitem
            name="Maintenance"
            id="maintenance"
            parent="base.menu_administration" groups="base.group_extended"/>

        <menuitem
            action="action_maintenance_contract_form"
            id="menu_maintenance_contract"
            parent="maintenance"/>

        <record id="maintenance_contract_add_wizard" model="ir.ui.view">
            <field name="name">maintenance.contract.add.wizard</field>
            <field name="model">maintenance.contract.wizard</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Add Maintenance Contract" col="2">
                    <image name="gtk-dialog-info" />
                    <group col="1">
                        <separator string="Add Maintenance Contract" />
                        <group states="draft">
                            <field name="name" width="250" />
                            <newline />
                            <field name="password" password="True" />
                            <field name="state" invisible="1" />
                        </group>
                        <group states="validated">
                            <label string="Maintenance contract added !"/>
                        </group>
                        <group states="unvalidated">
                            <label string="Could you check your contract information ?" />
                        </group>
                    </group>
                    <group colspan="4">
                        <button type="object" string="_Cancel" icon="gtk-cancel" special="cancel" states="draft"/>
                        <button type="object" string="_Validate" icon="gtk-apply" name="action_validate" states="draft"/>
                        <button type="object" string="_Cancel" icon="gtk-cancel" special="cancel" states="validated,unvalidated"/>
                    </group>
                </form>
            </field>
        </record>

        <record id="action_maintenance_contract_add_wizard" model="ir.actions.act_window">
            <field name="name">Add Maintenance Contract</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">maintenance.contract.wizard</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="target">new</field>
        </record>

        <menuitem
            action="action_maintenance_contract_add_wizard"
            id="menu_maintenance_contract_add"
            parent="maintenance" />

    </data>
</openerp>
