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

        <menuitem
            icon="terp-project" id="base.menu_main_pm"
            name="Project" sequence="10"
            groups="group_project_manager,group_project_user,base.group_system"/>

        <menuitem id="menu_project_management" name="Project Management" parent="base.menu_main_pm" sequence="1"/>
        <menuitem id="menu_definitions" name="Configuration" parent="base.menu_main_pm" sequence="60" groups="base.group_system"/>

        <!-- Project -->
        <record id="edit_project" model="ir.ui.view">
            <field name="name">project.project.form</field>
            <field name="model">project.project</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Project">
                    <group colspan="6" col="6">
                        <field name="name" string="Project Name" select="1"/>
                        <field name="parent_id" string="Parent Project"/>
                        <field name="user_id" string="Project Manager" select="1" attrs="{'readonly':[('state','in',['close', 'cancelled'])]}"/>
                        <field name="date_start" string="Start Date" attrs="{'readonly':[('state','in',['close', 'cancelled'])]}"/>
                        <field name="date" string="End Date" attrs="{'readonly':[('state','in',['close', 'cancelled'])]}"/>
                        <field name="progress_rate" widget="progressbar"/>
                    </group>
                    <notebook colspan="4">
                        <page string="Administration">
                            <group col="2" colspan="2">
                                <separator colspan="2" string="Scheduling"/>
                                <field name="priority"/>
                                <field name="active"/>
                            </group>
                            <group col="2" colspan="2">
                                <separator colspan="2" string="Performance"/>
                                <field name="planned_hours" widget="float_time"/>
                                <field name="effective_hours" widget="float_time" />
                            </group>
                            <group col="2" colspan="2" name="misc">
                                <separator colspan="2" string="Miscelleanous"/>
                                <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
                                <field name="warn_manager"/>
                            </group>
                            <newline/>
                            <separator colspan="4"/>
                            <group col="9" colspan="8">
                                <field name="state" select="1" readonly="1"/>
                                <button name="set_template" string="Set as Template" type="object" states="open" icon="gtk-convert"/>
                                <button name="set_open" string="Reactivate Project" type="object" states="pending,cancelled,close" icon="gtk-ok"/>
                                <button name="set_pending" string="Pending" type="object" states="open" icon="gtk-media-pause"/>
                                <button name="set_done" string="Done" type="object" states="open,pending" icon="terp-dialog-close"/>
                                <button name="set_cancel" string="Cancel" type="object" states="open,pending" icon="gtk-cancel"/>
                                <button name="reset_project" string="Reset as Project" type="object" states="template" icon="gtk-convert"/>
                                <button
                                    string="New Project Based on Template"
                                    name="duplicate_template"  type="object"
                                    states="template" icon="gtk-new" context="{'parent_id':parent_id}"/>
                            </group>
                        </page>
                        <page string="Members">
                            <field colspan="4" name="members" nolabel="1">
                                <tree string="Members">
                                    <field name="name"/>
                                    <field name="user_email"/>
                                    <field name="address_id"/>
                                </tree>
                            </field>
                        </page>
                        <page groups="base.group_extended" string="Partner Info">
                            <field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id)" select="1"/>
                            <field domain="[('partner_id','=',partner_id)]" name="contact_id" string="Contact Address"/>
                            <field name="warn_customer"/>
                            <newline/>
                            <separator colspan="2" string="Mail Header"/>
                            <separator colspan="2" string="Mail Footer"/>
                            <field name="warn_header" nolabel="1" colspan="2"/>
                            <field name="warn_footer" nolabel="1" colspan="2"/>
                            <group col="3" colspan="4">
                                <separator string="Automatic variables for headers and footer. Use exactly the same notation." colspan="4"/>
                                <label string="Task: %%(name)s"/>
                                <label string="User: %%(user_id)s"/>
                                <label string="ID: %%(task_id)s"/>
                                <label string="Status: %%(state)s"/>
                                <label string="Date Start: %%(date_start)s"/>
                                <label string="Date Stop: %%(date_stop)s"/>
                            </group>
                        </page>
                        <page string="Tasks Stages" groups="base.group_extended">
                           <field nolabel="1" name="type_ids" colspan="4"/>
                        </page>
                        <page string="Notes">
                            <field colspan="4" name="description" nolabel="1"/>
                        </page>
                    </notebook>
                    <newline/>
                </form>
            </field>
        </record>

       <record id="view_project_project_filter" model="ir.ui.view">
            <field name="name">project.project.select</field>
            <field name="model">project.project</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Search Project">
                   <group col='15' colspan='4'>
                       <filter icon="terp-check" string="Current" name="Current" domain="[('state', 'in',('open','pending'))]" help="Open and Pending Projects" default="1"/>
                       <separator orientation="vertical"/>
                       <filter icon="terp-personal" string="Manager" name="Manager" domain="[('user_id', '=', uid)]" help="Projects in which I am a manager."/>
                       <filter icon="terp-personal+" string="Member" domain="['|',('user_id', '=', uid),('members', '=', uid)]" help="Projects in which I am a member." default="1"/>
                       <separator orientation="vertical"/>
                       <field name="name" string="Project Name"/>
                       <field name="user_id" string="Project Manager" default="1"/>
                       <field name="partner_id" string="Partner"/>
                   </group>
                   <newline />
                    <group expand="0" string="Group By..." colspan="4" col="20" groups="base.group_extended">
                        <filter string="Manager" name="Manager"  icon="terp-personal" domain = "[]" context="{'group_by':'user_id'}"/>
                        <filter string="Partner" name="Partner" icon="terp-partner" domain = "[]" context="{'group_by':'partner_id'}"/>
                         <separator orientation="vertical"/>
                        <filter string="Parent" name="Parent"  help="Parent Project" icon="terp-folder-blue" domain = "[]" context="{'group_by':'parent_id'}"/>
                    </group>
               </search>
            </field>
        </record>

        <record id="view_project" model="ir.ui.view">
            <field name="name">project.project.tree</field>
            <field name="model">project.project</field>
            <field name="type">tree</field>
            <field name="field_parent">child_ids</field>
            <field name="arch" type="xml">
                <tree colors="red:date and (date&lt;current_date) and (state in ('open'));blue:state in ('draft','pending');grey: state in ('close','cancelled')" string="Projects">
                    <field name="sequence" invisible="1"/>
                    <field name="date" invisible="1"/>
                    <field name="name" string="Project Name"/>
                    <field name="user_id" string="Project Manager"/>
                    <field name="partner_id" string="Partner"/>
                    <field name="parent_id" invisible="1"/>
                    <field name="planned_hours" widget="float_time"/>
                    <field name="total_hours" widget="float_time"/>
                    <field name="effective_hours" widget="float_time"/>
                    <field name="progress_rate" widget="progressbar"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>

        <record id="open_view_project_all" model="ir.actions.act_window">
            <field name="name">Projects</field>
            <field name="res_model">project.project</field>
            <field name="view_type">form</field>
            <field name="domain">[]</field>
            <field name="view_id" ref="view_project"/>
            <field name="search_view_id" ref="view_project_project_filter"/>
            <field name="context">{'search_default_Current':1}</field>
            <field name="help">Consult and define your projects here. A project contains a set of related activities that will be performed by your company. Any project can be put into a hierarchy, as a child of a Parent Project. This allows you to design large project structure very useful for work organization.</field>
        </record>
        <menuitem action="open_view_project_all" id="menu_open_view_project_all" parent="menu_project_management" sequence="1"/>

        <record id="open_view_template_project" model="ir.actions.act_window">
            <field name="name">Templates of Projects</field>
            <field name="res_model">project.project</field>
            <field name="view_type">form</field>
            <field name="domain">[('state','=','template')]</field>
            <field name="view_id" ref="view_project"/>
        </record>

        <record id="view_task_work_form" model="ir.ui.view">
            <field name="name">project.task.work.form</field>
            <field name="model">project.task.work</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Task Work">
                    <field colspan="4" name="name" select="1"/>
                    <field name="hours" select="1" widget="float_time"/>
                    <field name="date" select="1"/>
                    <field name="user_id" select="1"/>
                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                </form>
            </field>
        </record>

        <record id="view_task_work_tree" model="ir.ui.view">
            <field name="name">project.task.work.tree</field>
            <field name="model">project.task.work</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree editable="top" string="Task Work">
                    <field name="date"/>
                    <field name="name"/>
                    <field name="hours" widget="float_time"/>
                    <field name="user_id"/>
                </tree>
            </field>
        </record>

        <!-- Task -->
        <record id="view_task_form2" model="ir.ui.view">
            <field name="name">project.task.form</field>
            <field name="model">project.task</field>
            <field name="type">form</field>
            <field eval="2" name="priority"/>
            <field name="arch" type="xml">
                <form string="Task edition">
                    <group colspan="6" col="6">
                        <field name="name" select="1"/>
                        <field name="project_id" required="1" select="1" domain="[('user_id','=',uid)]"/>
                        <field name="total_hours" widget="float_time"/>
                        <field name="date_deadline" attrs="{'readonly':[('state','in',['done', 'cancelled'])]}"/>
                        <field name="user_id" select="1" attrs="{'readonly':[('state','in',['done', 'cancelled'])]}"/>
                        <field name="progress" widget="progressbar"/>
                    </group>
                    <notebook colspan="4">
                        <page string="Information">
                            <group col="2" colspan="2">
                                <field
                                    name="planned_hours"
                                    widget="float_time"
                                    attrs="{'readonly':[('state','!=','draft')]}"
                                    on_change="onchange_planned(planned_hours, effective_hours)"/>
                                <field name="effective_hours" widget="float_time"/>
                            </group>
                            <group col="3" colspan="2">
                                <field name="remaining_hours" widget="float_time" attrs="{'readonly':[('state','!=','draft')]}" colspan="2"/>
                                <button name="%(action_project_task_reevaluate)d" string="Reevaluate" type="action" colspan="1" target="new" states="open,pending" icon="gtk-edit"/>

                                <field name="delay_hours" widget="float_time"/>
                            </group>

                            <field colspan="4" name="description" nolabel="1"  attrs="{'readonly':[('state','=','done')]}" widget="text_wiki"/>
                            <field colspan="4" name="work_ids" nolabel="1" attrs="{'readonly':[('state','in',['draft','done'])]}">
                                <tree string="Task Work" editable="top">
                                    <field name="name" />
                                    <field name="hours" widget="float_time" />
                                    <field name="user_id" />
                                    <field name="date" />
                                </tree>
                            </field>
                            <newline/>
                            <group col="11" colspan="4">
                                <field name="state" select="1"/>
                                <button name="do_draft" states="open" string="Draft" type="object" icon="gtk-indent"/>
                                <button name="do_open" states="pending,draft" string="Start Task" type="object" icon="gtk-execute"/>
                                <button name="%(action_project_task_reevaluate)d" states="done,cancelled" string="Reactivate" type="action" icon="gtk-convert" context="{'button_reactivate':True}" />
                                <button name="do_pending" states="open" string="Pending" type="object" icon="gtk-media-pause"/>
                                <button groups="base.group_extended" name="%(action_project_task_delegate)d" states="pending,open" string="Delegate" type="action" icon="gtk-sort-descending"/>
                                <button name="action_close" states="pending,open" string="Done" type="object" icon="terp-dialog-close"/>
                                <button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel"/>
                            </group>
                        </page>
                        <page groups="base.group_extended" string="Delegations">
                            <separator string="Parent Tasks" colspan="4"/>
                            <field colspan="4" height="150" name="parent_ids" nolabel="1"/>
                            <separator string="Delegated tasks" colspan="4"/>
                            <field colspan="4" height="150" name="child_ids" nolabel="1">
                                <tree string="Delegated tasks">
                                    <field name="name"/>
                                    <field name="user_id"/>
                                    <field name="state"/>
                                    <field name="effective_hours" widget="float_time"/>
                                    <field name="progress" widget="progressbar"/>
                                    <field name="remaining_hours" widget="float_time"/>
                                    <field name="date_deadline"/>
                                </tree>
                            </field>
                        </page>

                        <page groups="base.group_extended" string="Extra Info" attrs="{'readonly':[('state','=','done')]}">
                            <group colspan="2" col="2">
                                <separator string="Planning" colspan="2"/>
                                <field name="priority"/>
                                <field name="sequence"/>
                            </group>
                            <group colspan="2" col="2">
                                <separator string="Dates" colspan="2"/>
                                <field name="date_start"/>
                                <field name="date_end"/>
                                <field name="create_date"/>
                            </group>
                            <separator string="Miscelleanous" colspan="4"/>
                            <field name="partner_id"/>
                            <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
                            <group col="4" colspan="2">
                                <field name="type_id" widget="selection" readonly="1"/>
                                <button name="prev_type" string="Previous" type="object" icon="gtk-go-back" help="Change to Previous Stage"/>
                                <button name="next_type" string="Next" type="object" icon="gtk-go-forward" help="Change to Next Stage"/>
                            </group>
                            <separator colspan="4" string="Notes"/>
                            <field colspan="4" name="notes" nolabel="1"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>

        <record id="view_task_tree2" model="ir.ui.view">
            <field name="name">project.task.tree</field>
            <field name="model">project.task</field>
            <field name="type">tree</field>
            <field eval="2" name="priority"/>
            <field name="arch" type="xml">
                <tree colors="grey:state in ('cancelled','done');blue:remaining_hours&lt;0 and state in ('pending');red:bool(date_deadline) and (date_deadline&lt;current_date) and (state in ('draft','open'));black:state not in ('cancelled','done')" string="Tasks">
                    <field name="sequence" invisible="not context.get('seq_visible', False)"/>
                    <field name="name"/>
                    <field name="project_id" icon="gtk-indent" domain="['|',('user_id','=',uid),('members','=',uid)]"/>
                    <field name="user_id"/>
                    <field name="delegated_user_id" invisible="context.get('show_delegated', True)"/>
                    <field name="planned_hours"/>
                    <field name="remaining_hours" widget="float_time" sum="Remaining Hours" invisible="context.get('set_visible',False)"/>
                    <field name="delay_hours"/>
                    <field name="date_deadline" invisible="context.get('set_visible',False)"/>
                    <field name="type_id" groups="base.group_extended" invisible="context.get('set_visible',False)"/>
                    <button name="next_type" invisible="context.get('set_visible',False)"
                        states="draft,open,pending"
                        string="Change Stage"
                        type="object"
                        icon="gtk-go-forward"
                        groups="base.group_extended"
                        help="Change Type"/>
                    <field name="date_start" invisible="1"/>
                    <field name="date_end" invisible="1"/>
                    <field name="progress" widget="progressbar" invisible="context.get('set_visible',False)"/>
                    <field name="state" invisible="context.get('set_visible',False)"/>
                    <button name="do_open" states="pending,draft,done,cancel" string="Start Task" type="object" icon="gtk-execute" help="For changing to open state" invisible="context.get('set_visible',False)"/>
                    <button groups="base.group_extended" name="%(action_project_task_delegate)d" states="pending,open,draft" string="Delegate" type="action" icon="gtk-sort-descending" help="For changing to delegate state"/>
                    <button name="action_close" states="draft,pending,open" string="Done" type="object" icon="gtk-apply" help="For changing to done state"/>
                    <button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel" help="For cancelling the task"/>
                </tree>
            </field>
        </record>

        <record id="view_task_calendar" model="ir.ui.view">
            <field name="name">project.task.calendar</field>
            <field name="model">project.task</field>
            <field name="type">calendar</field>
            <field eval="2" name="priority"/>
            <field name="arch" type="xml">
                <calendar color="user_id" date_delay="planned_hours" date_start="date_start" string="Tasks">
                    <field name="name"/>
                    <field name="project_id"/>
                </calendar>
            </field>
        </record>

        <record id="view_task_gantt" model="ir.ui.view">
            <field name="name">project.task.gantt</field>
            <field name="model">project.task</field>
            <field name="type">gantt</field>
            <field eval="2" name="priority"/>
            <field name="arch" type="xml">
                <gantt color="user_id" date_delay="planned_hours" date_start="date_start" string="Tasks">
                    <level object="project.project" link="project_id" domain="[]">
                        <field name="name"/>
                    </level>
                </gantt>
            </field>
        </record>

        <record id="view_project_task_graph" model="ir.ui.view">
            <field name="name">project.task.graph</field>
            <field name="model">project.task</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph string="Project Tasks" type="bar">
                    <field name="project_id"/>
                    <field name="planned_hours" operator="+"/>
                    <field name="delay_hours" operator="+"/>
                </graph>
            </field>
        </record>

        <record id="view_task_search_form" model="ir.ui.view">
            <field name="name">project.task.search.form</field>
            <field name="model">project.task</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
               <search string="Task Edition">
                    <group col="20" colspan="4">
                        <filter string="Current" domain="[('state','in',('open','draft'))]"  name="current" help="Draft, In Progress and Pending Tasks" icon="terp-check" default="1"/>
                        <filter string="In Progress" domain="[('state','=','open')]" help="In Progress Tasks" icon="terp-camera_test"/>
                        <filter string="Pending" domain="[('state','=','pending')]" context="{'show_delegated':False}" help="Pending Tasks" icon="terp-gtk-media-pause"/>
                        <separator orientation="vertical"/>
						<filter name="edit"
	                        string="Edit" context="{'set_editable':True,'seq_visible': True}"
	                        icon="gtk-execute"
	                        groups="base.group_extended"/>
                        <separator orientation="vertical"/>
                        <filter string="Deadlines" domain="[('date_deadline','&lt;&gt;',False)]" help="Show only tasks having a deadline" icon="terp-gnome-cpu-frequency-applet+"/>
                        <separator orientation="vertical"/>
                        <field name="name" select="1"/>
                        <field name="project_id" select="1">
                             <filter domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-personal"/>
                        </field>
                        <field name="user_id" select="1">
                            <filter domain="[('user_id','=',False)]"  help="Unassigned Tasks" icon="terp-personal-" separator="1"/>
                        </field>
                    </group>
                    <newline/>
                    <group expand="0" string="Group By..." colspan="4" col="20">
                        <filter string="Users" name="group_user_id" icon="terp-personal" domain="[]"  context="{'group_by':'user_id'}"/>
                        <separator orientation="vertical"/>
                        <filter string="Project" name="group_project_id" icon="terp-folder-blue" domain="[]" context="{'group_by':'project_id'}"/>
                        <separator orientation="vertical"/>
                        <filter string="Stages" name="group_stage_id" icon="terp-stage" domain="[]" context="{'group_by':'type_id'}"/>
                        <filter string="State" name="group_state" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
                        <separator orientation="vertical"/>
                        <filter string="Deadline" icon="terp-gnome-cpu-frequency-applet+" domain="[]" context="{'group_by':'date_deadline'}"/>
                        <separator orientation="vertical"/>
                        <filter string="Start Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
                        <filter string="End Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_end'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="action_view_task" model="ir.actions.act_window">
            <field name="name">Tasks</field>
            <field name="res_model">project.task</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form,calendar,gantt,graph</field>
            <field eval="False" name="filter"/>
            <field name="view_id" ref="view_task_tree2"/>
            <field name="context">{"search_default_project_id":project_id, "search_default_user_id":uid, "search_default_current": 1}</field>
            <field name="search_view_id" ref="view_task_search_form"/>
            <field name="help">In OpenERP, a project is made of a set of activities (or tasks) for completion. A list view allows the manager to quickly check for task status and make it evolve, delegate task, etc. A search tool allows a multi-criteria sort of activities.</field>
        </record>
        <menuitem action="action_view_task" id="menu_action_view_task" parent="project.menu_project_management" sequence="2"/>

        <record id="action_view_task_overpassed_draft" model="ir.actions.act_window">
            <field name="name">Overpassed Tasks</field>
            <field name="res_model">project.task</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form,calendar,graph</field>
            <field name="domain">[('date_deadline','&lt;',time.strftime('%Y-%m-%d')),('state','in',('draft','pending','open'))]</field>
            <field name="filter" eval="True"/>
            <field name="search_view_id" ref="view_task_search_form"/>
        </record>

        <!-- Opening task when double clicking on project -->
        <record id="dblc_proj" model="ir.actions.act_window">
            <field name="res_model">project.task</field>
            <field name="name">Project's tasks</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form,calendar,graph,gantt</field>
            <field name="domain">[('project_id', 'child_of', [active_id])]</field>
            <field name="context">{'project_id':active_id, 'active_test':False}</field>
        </record>

        <record id="ir_project_task_open" model="ir.values">
            <field eval=" 'tree_but_open'" name="key2"/>
            <field eval="'project.project'" name="model"/>
            <field name="name">View project's tasks</field>
            <field eval="'ir.actions.act_window,'+str(dblc_proj)" name="value"/>
            <field eval="True" name="object"/>
        </record>

        <!-- Task types -->
        <record id="task_type_edit" model="ir.ui.view">
            <field name="name">project.task.type.form</field>
            <field name="model">project.task.type</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Task Stage">
                    <field name="name" select="1"/>
                    <field name="sequence"/>
                    <separator string="Description" colspan="4"/>
                    <field colspan="4" name="description" nolabel="1"/>
                </form>
            </field>
        </record>

        <record id="task_type_tree" model="ir.ui.view">
            <field name="name">project.task.type.tree</field>
            <field name="model">project.task.type</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Task Stage">
                    <field name="sequence"/>
                    <field name="name"/>
                </tree>
            </field>
        </record>

        <record id="open_task_type_form" model="ir.actions.act_window">
            <field name="name">Task Stages</field>
            <field name="res_model">project.task.type</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="task_type_tree"/>
        </record>

        <menuitem id="menu_tasks_config" name="Tasks" parent="project.menu_definitions" sequence="1" groups="base.group_system"/>
        <menuitem action="open_task_type_form" id="menu_task_types_view" parent="menu_tasks_config" sequence="1"/>

        <act_window context="{'search_default_user_id': [active_id]}" id="act_res_users_2_project_project" name="User's projects" res_model="project.project" src_model="res.users" view_mode="tree,form" view_type="form"/>

        <act_window
        	context="{'search_default_project_id': [active_id]}"
            id="act_project_project_2_project_task_all"
            name="Tasks"
            res_model="project.task"
            src_model="project.project"
            view_mode="tree,form,calendar,graph"
            view_type="form"/>

         <record id="task_company" model="ir.ui.view">
            <field name="name">res.company.task.config</field>
            <field name="model">res.company</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="base.view_company_form"/>
            <field name="arch" type="xml">
                <page string="Configuration" position="inside">
                    <separator string="Project Management" colspan="4"/>
                    <field name="project_time_mode_id"/>
                    <newline/>
                </page>
            </field>
        </record>

      <!--     User Form-->
      <record id="view_project_users_form_simple" model="ir.ui.view">
          <field name="name">res.users.project.form1</field>
          <field name="model">res.users</field>
          <field name="type">form</field>
          <field name="inherit_id" ref="base.view_users_form"/>
          <field eval="18" name="priority"/>
          <field name="arch" type="xml">
              <field name="password" position="after">
                   <field name="context_project_id"/>
              </field>
          </field>
     </record>

     <record model="ir.ui.view" id="view_users_form_project_modif_inherited1">
         <field name="name">view.users.form.project.modif.inherited1</field>
         <field name="model">res.users</field>
         <field name="inherit_id" ref="base.view_users_form_simple_modif" />
         <field name="type">form</field>
         <field eval="18" name="priority"/>
         <field name="arch" type="xml">
            <page string="Current Activity" position="inside">
                <field name="context_project_id" completion="1" context="{'user_prefence':True}" widget="selection" readonly="0"/>
            </page>
       </field>
    </record>
    <act_window context="{'search_default_user_id': [active_id]}" domain="[('state', '&lt;&gt;', 'cancelled'),('state', '&lt;&gt;', 'done')]" id="act_res_users_2_project_task_opened" name="Assigned tasks" res_model="project.task" src_model="res.users" view_mode="tree,form,gantt,calendar,graph" view_type="form"/>
    <act_window context="{'search_default_user_id': [active_id]}" domain="[('date', '&gt;=', time.strftime('%Y-%m-01'))]" id="act_res_users_2_project_task_work_month" name="Month works" res_model="project.task.work" src_model="res.users" view_mode="tree,form" view_type="form"/>
    </data>
</openerp>
