[MERGE]
[odoo/odoo.git] / addons / project_long_term / project_long_term_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5     <menuitem id="base.menu_project_long_term" name="Long Term Planning" parent="base.menu_main_pm" sequence="1"/>
6
7     # ------------------------------------------------------
8     # Project Resource Allocation
9     # ------------------------------------------------------
10
11         <record id="view_project_resource_allocation_gantt" model="ir.ui.view">
12             <field name="name">project.resource.allocation.gantt</field>
13             <field name="model">project.resource.allocation</field>
14             <field name="type">gantt</field>
15             <field name="arch" type="xml">
16               <gantt color="phase_id" date_start="phase_id_date_start" date_stop="phase_id_date_end" string="R.A." mode="year">
17                <level object="project.resource" link="resource_id" domain="[]">
18                    <field name="useability"/>
19                 </level>
20               </gantt>
21             </field>
22         </record>
23
24
25         <record id="view_project_resource_allocation_form" model="ir.ui.view">
26             <field name="name">project.resource.allocation.form</field>
27             <field name="model">project.resource.allocation</field>
28             <field name="type">form</field>
29             <field name="arch" type="xml">
30                 <form string="Project Resource Allocation">
31                     <field name="resource_id" select="1"/>
32                     <field name="phase_id"/>
33                     <field name="useability"/>
34                 </form>
35             </field>
36         </record>
37
38         <record id="view_project_resource_allocation_list" model="ir.ui.view">
39             <field name="name">project.resource.allocation.list</field>
40             <field name="model">project.resource.allocation</field>
41             <field name="type">tree</field>
42             <field name="priority" eval="5"/>
43             <field name="arch" type="xml">
44                 <tree editable="bottom" string="Project Resource Allocation">
45                     <field name="resource_id"/>
46                     <field name="phase_id"/>
47                     <field name="useability"/>
48                 </tree>
49             </field>
50         </record>
51
52        <record id="view_project_resource_allocation_search" model="ir.ui.view">
53             <field name="name">project.resource.allocation.search</field>
54             <field name="model">project.resource.allocation</field>
55             <field name="type">search</field>
56             <field name="arch" type="xml">
57                 <search string="Resource Allocations">
58                     <group colspan="4" col="20">
59                         <field name="resource_id"/>
60                         <field name="phase_id"/>
61                     </group>
62                     <newline/>
63                     <group expand="1" string="Group By..." colspan="4" col="20">
64                         <filter name="resource" string="Resource" icon="terp-folder-blue" domain="[]" context="{'group_by':'resource_id'}"/>
65                         <filter string="Phase" icon="terp-project" domain="[]" context="{'group_by':'phase_id'}"/>
66                     </group>
67                 </search>
68             </field>
69         </record>
70
71        <record id="act_resouce_allocation" model="ir.actions.act_window">
72             <field name="name">Resource Allocations</field>
73             <field name="res_model">project.resource.allocation</field>
74             <field name="view_type">form</field>
75             <field name="view_mode">tree,form,gantt</field>
76              <field name="context">{}</field>
77             <field name="search_view_id" ref="view_project_resource_allocation_search"/>
78         </record>
79
80
81     # ------------------------------------------------------
82     # Project Phase
83     # ------------------------------------------------------
84
85         <record id="view_project_phase_form" model="ir.ui.view">
86             <field name="name">project.phase.form</field>
87             <field name="model">project.phase</field>
88             <field name="type">form</field>
89             <field name="arch" type="xml">
90                 <form string="Project Phase">
91                     <group colspan="6" col="6">
92                         <field name="name" select="1"/>
93                         <field name="project_id" on_change="onchange_project(project_id)"/>
94                         <field name="responsible_id"/>
95                     </group>
96                     <group colspan="6" col="6">
97                         <field name="duration" />
98                         <field name="product_uom" nolabel="1" domain="[('category_id.name', '=', 'Working Time')]"/>
99                         <field name="date_start"/>
100                         <field name="date_end"/>
101                     </group>
102                     <notebook colspan="4">
103                         <page string="Resource Allocation">
104                             <field colspan="4" name="resource_ids" nolabel="1">
105                                  <tree editable="bottom" string="Project Resource Allocation">
106                                     <field name="resource_id" context="{'project_id':parent.project_id}"/>
107                                     <field name="useability"/>
108                                   </tree>
109                                   <form string="Project Resource Allocation">
110                                     <field name="resource_id" context="{'project_id':parent.project_id}"/>
111                                     <field name="useability"/>
112                                   </form>
113                              </field>
114                             <separator string="" colspan="4"/>
115                             <group col="12" colspan="4">
116                                 <field name="state" select="1"/>
117                                 <button string="Draft" name="set_draft" states="open" icon="gtk-indent"/>
118                                 <button string="Start Phase" name="set_open" states="pending,draft" icon="gtk-execute"/>
119                                 <button string="Done" name="set_done" states="pending,open" icon="gtk-apply"/>
120                                 <button string="Pending" name="set_pending" states="open" icon="gtk-media-pause"/>
121                                 <button string="Cancel" name="set_cancel" states="draft,open,pending" icon="gtk-cancel"/>
122                             </group>
123                         </page>
124                         <page string="Task Detail">
125                             <field colspan="4" name="task_ids" context="{'default_project_id' :project_id}" nolabel="1">
126                                  <tree editable="bottom" string="Project's Tasks">
127                                     <field name="name"/>
128                                     <field name="user_id"/>
129                                     <field name="planned_hours" widget="float_time"/>
130                                     <field name="project_id" invisible="1"/>
131                                   </tree>
132                                   <form string="Project's Tasks">
133                                       <notebook colspan="4">
134                                           <page string="Task Detail">
135                                               <group colspan="4" col="4">
136                                                 <field name="name"/>
137                                                 <field name="project_id"/>
138                                                 <field name="user_id"/>
139                                             </group>
140                                             <group colspan="2" col="2">
141                                                   <separator string="Dates" colspan="2"/>
142                                                   <field name="date_start"/>
143                                                   <field name="date_deadline"/>
144                                             </group>
145                                             <group colspan="2" col="2">
146                                                   <separator string="Planning" colspan="2"/>
147                                                   <field name="planned_hours" widget="float_time"/>
148                                                 <field name="remaining_hours" widget="float_time" sum="Remaining Hours"/>
149                                                 <field name="effective_hours" invisible="1"/>
150                                             </group>
151                                             <group colspan="6" col="4">
152                                                 <field name="state"/>
153                                             </group>
154                                         </page>
155                                     </notebook>
156                                   </form>
157                              </field>
158                                <button name="%(action_project_schedule_tasks)d" string="Schedule Tasks" type="action" icon="gtk-jump-to"/>
159                         </page>
160                         <page string="Other Info">
161                            <group colspan="2" col="2">
162                                 <separator string="Constraints" colspan="2"/>
163                                 <field name="constraint_date_start"/>
164                                 <field name="constraint_date_end"/>
165                             </group>
166                             <group colspan="2" col="2">
167                                 <separator string="Scheduling" colspan="2"/>
168                                 <field name="sequence"/>
169                             </group>
170                            <separator colspan="4" string="Previous Phases"/>
171                            <field colspan="4" name="previous_phase_ids" nolabel="1"/>
172                            <separator colspan="4" string="Next Phases"/>
173                            <field colspan="4" name="next_phase_ids" nolabel="1"/>
174                         </page>
175                     </notebook>
176                     <newline/>
177                 </form>
178             </field>
179         </record>
180
181         <record id="view_project_phase_list" model="ir.ui.view">
182             <field name="name">project.phase.list</field>
183             <field name="model">project.phase</field>
184             <field name="type">tree</field>
185             <field name="priority" eval="5"/>
186             <field name="arch" type="xml">
187                 <tree string="Project Phases">
188                     <field name="name"/>
189                     <field name="project_id" on_change="onchange_project(project_id)"/>
190                     <field name="responsible_id"/>
191                     <field name="date_start"/>
192                     <field name="state"/>
193                 </tree>
194             </field>
195         </record>
196
197         <record id="view_project_phase_calendar" model="ir.ui.view">
198             <field name="name">project.phase.calendar</field>
199             <field name="model">project.phase</field>
200             <field name="type">calendar</field>
201             <field eval="2" name="priority"/>
202             <field name="arch" type="xml">
203                 <calendar color="responsible_id" date_start="date_start" date_stop="date_end" day_length="12" string="Phases">
204                     <field name="name"/>
205                     <field name="project_id"/>
206                 </calendar>
207             </field>
208         </record>
209
210         <record id="view_project_phase_gantt" model="ir.ui.view">
211             <field name="name">project.phase.gantt</field>
212             <field name="model">project.phase</field>
213             <field name="type">gantt</field>
214             <field eval="2" name="priority"/>
215             <field name="arch" type="xml">
216                 <gantt color="responsible_id" date_stop="date_end" date_start="date_start" string="Phases">
217                     <level object="project.project" link="project_id" domain="[]">
218                         <field name="name"/>
219                     </level>
220                 </gantt>
221             </field>
222         </record>
223
224         <record id="view_project_phase_search" model="ir.ui.view">
225             <field name="name">project.phase.search</field>
226             <field name="model">project.phase</field>
227             <field name="type">search</field>
228             <field name="arch" type="xml">
229                 <search string="Project Phases">
230                     <group colspan="4" col="20">
231                         <filter string="Draft" domain="[('state','=','draft')]" help="Draft Phases" icon="terp-check" default="1"/>
232                         <filter string="In Progress" name="Progress" domain="[('state','=','open')]" help="Open Phases" icon="terp-camera_test"/>
233                         <filter string="Pending" domain="[('state','=','pending')]" help="Pending Phases" icon="terp-gtk-media-pause"/>
234                         <separator orientation="vertical"/>
235                         <field name="name"/>
236                         <field name="project_id">
237                             <filter domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-folder-blue"/>
238                         </field>
239                         <field name="responsible_id"/>
240                         <field name="date_start"/>
241                     </group>
242                     <newline/>
243                     <group expand="1" string="Group By..." colspan="4" col="20" groups="base.group_extended">
244                         <filter string="Project" icon="terp-folder-blue" domain="[]" context="{'group_by':'project_id'}"/>
245                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
246                         <filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'responsible_id'}"/>
247                         <filter string="Start Date" icon="terp-gtk-jump-to-ltr" domain="[]" context="{'group_by':'date_start'}"/>
248                     </group>
249                 </search>
250             </field>
251         </record>
252
253         <record id="act_project_phase" model="ir.actions.act_window">
254             <field name="name">Project Phases</field>
255             <field name="res_model">project.phase</field>
256             <field name="view_type">form</field>
257             <field name="view_mode">tree,form,gantt,calendar</field>
258             <field name="context">{'search_default_responsible_id':uid}</field>
259             <field name="search_view_id" ref="view_project_phase_search"/>
260             <field name="help">You can subdivide your larger projects into several phases. For each phase, you can define your resources allocation (humans or engine), describe de differend task and link your phase with previous and next one, add constraints date and scheduling. A gantt view of your project phase is also available from this menu. Gantt view is a graphically draw of the project plan; it includes any task dependencies by visually adjusting task durations and priorities, and by linking tasks to each other.</field>            
261         </record>
262
263         <record id="act_project_phase_list" model="ir.actions.act_window">
264             <field name="name">Project Phases</field>
265             <field name="res_model">project.phase</field>
266             <field name="view_type">form</field>
267             <field name="view_mode">tree,form,calendar</field>
268                         <field name="context">{'search_default_responsible_id':uid}</field>
269             <field name="search_view_id" ref="view_project_phase_search"/>
270         </record>
271
272
273     # ------------------------------------------------------
274     # Project
275     # ------------------------------------------------------
276
277         <record id="view_phase_project_form1" model="ir.ui.view">
278             <field name="name">phase.project.form1</field>
279             <field name="model">project.project</field>
280             <field name="type">form</field>
281             <field name="inherit_id" ref="project.edit_project"/>
282             <field name="arch" type="xml">
283                 <field name="priority" position="before">
284                     <field name="resource_calendar_id"/>
285                 </field>
286
287             </field>
288        </record>
289
290     # ------------------------------------------------------
291     # Project Task
292     # ------------------------------------------------------
293
294     <act_window
295         id="project_phase_task_list"
296         name="Related Tasks"
297         res_model="project.task"
298         src_model="project.phase"
299         view_mode="tree,form"
300         domain="[('phase_id','=',active_id)]"/>
301
302     <act_window
303         domain="[('project_id', '=', active_id)]"
304         id="act_project_phases"
305         name="Phases"
306         res_model="project.phase"
307         src_model="project.project"
308         view_mode="tree,form"
309         view_type="form" />
310
311     # ------------------------------------------------------
312     # Menu Items
313     # ------------------------------------------------------
314
315         <menuitem action="act_project_phase"
316             groups="base.group_extended"
317             id="menu_project_phase"   parent="base.menu_project_long_term" sequence="1"/>
318
319         <menuitem id="menu_resouce_allocation" action="act_resouce_allocation"
320             name="Resource Allocations" parent="base.menu_project_long_term" sequence="2"/>
321
322         <menuitem id="menu_pm_resources_project1"
323             groups="base.group_extended"  
324             name="Resources" parent="project.menu_definitions" sequence="3"/>
325
326         <menuitem id="menu_phase_schedule" name="Scheduling" parent="base.menu_project_long_term" sequence="4" groups="project.group_project_user,project.group_project_manager,base.group_system"/>
327         <menuitem action="resource.action_resource_resource_tree" id="menu_view_resource" parent="project.menu_project_management" sequence="4"/>
328         <menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar" parent="menu_pm_resources_project1" sequence="1"/>
329         <menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves" parent="menu_pm_resources_project1" sequence="1"/>
330
331     </data>
332 </openerp>