[MOD] project_*: usability improvement in access rights
[odoo/odoo.git] / addons / project_planning / project_planning_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <!-- Planning -->
6         <record id="account_analytic_planning_view_tree" model="ir.ui.view">
7             <field name="name">report.account.analytic.planning.tree</field>
8             <field name="model">report_account_analytic.planning</field>
9             <field name="type">tree</field>
10             <field name="arch" type="xml">
11                 <tree string="Planning">
12                     <field name="name" />
13                     <field name="user_id" />
14                     <field name="date_from" />
15                     <field name="date_to" />
16                     <field name="business_days" />
17                     <field name="total_planned" />
18                     <field name="total_free" />
19                     <field name="state" />
20                 </tree>
21             </field>
22         </record>
23
24         <record id="account_analytic_planning_view_form" model="ir.ui.view">
25             <field name="name">report.account.analytic.planning.form</field>
26             <field name="model">report_account_analytic.planning</field>
27             <field name="type">form</field>
28             <field name="arch" type="xml">
29                 <form string="Planning by Account">
30                     <group col="6" colspan="4">
31                         <field name="name" select="1" />
32                         <field name="code" select="1" />
33                         <field name="user_id" select="1" />
34                         <field name="business_days" />
35                         <field name="date_from" />
36                         <field name="date_to" />
37                     </group>
38                     <notebook colspan="4">
39                         <page string="Planning by User">
40                         <field colspan="4" name="planning_user_ids"
41                                 nolabel="1" widget="one2many_list" readonly="1">
42                             <tree string="Planning By User (in Days)">
43                                 <field name="user_id"/>
44                                 <field name="tasks" sum="Total Remaining Tasks"/>
45                                 <field name="plan_tasks" sum="Total Time Allocation of Tasks"/>
46                                 <field name="plan_open" sum="Total Time Allocation without Tasks"/>
47                                 <field name="holiday" />
48                                 <field name="free" sum="Total Unallocated Time"/>
49                                 <field name="timesheet"/>
50                             </tree>
51                         </field>
52                         </page>
53                         <page string="Planning by Account">
54                         <field colspan="4" name="planning_account"
55                                 nolabel="1" widget="one2many_list" readonly="1">
56                             <tree string="Planning By Account (in Days)">
57                                 <field name="account_id" />
58                                 <field name="tasks" sum="Total Remaining Tasks"/>
59                                 <field name="plan_tasks" sum="Total Time Allocation of Tasks"/>
60                                 <field name="plan_open" sum="Total Time Allocation without Tasks"/>
61                                 <field name="timesheet" />
62                             </tree>
63                         </field>
64                         </page>
65                         <page string="Time Encoding">
66                             <field colspan="4" name="line_ids"
67                                 nolabel="1">
68                                 <tree editable="bottom"
69                                     string="Planning Lines">
70                                     <field name="user_id"/>
71                                     <field name="account_id" />
72                                     <field name="amount" />
73                                     <field name="amount_unit" />
74                                     <field name="task_ids" />
75                                     <field name="note" />
76                                     <field name="amount_in_base_uom" invisible="1" sum="Total Planned (in Days)"/>
77
78                                 </tree>
79                                 <form string="Planning Lines">
80                                     <field name="user_id" domain="[('id','child_of',[parent.user_id])]"/>
81                                     <field name="account_id" />
82                                     <field name="amount" />
83                                     <field name="amount_unit" />
84 <!--                                    WIDGET MANY2MANY GIVES ERROR-->
85 <!--                                    <field name="task_ids" colspan="4" nolabel="1" widget="many2many"/>-->
86                                        <field name="task_ids" colspan="4" nolabel="1" mode="tree,form">
87                                         <form string="Tasks">
88                                                 <group colspan="4" col="2">
89                                                 <field name="name" select="1"/>
90                                                 <field name="project_id" required="1" select="1" domain="[('analytic_account_id','=',parent.account_id)]"/>
91                                             </group>
92                                             <group colspan="4" col="4">
93                                                 <field name="date_deadline"/>
94                                                 <field name="user_id" select="1"  domain="[('id','=',parent.user_id)]"/>
95                                             </group>
96                                             <notebook colspan="4">
97                                                 <page string="Information">
98                                                     <group col="3" colspan="4">
99                                                         <field name="effective_hours" widget="float_time" invisible="True" />
100                                                         <field name="planned_hours"
101                                                             widget="float_time"
102                                                             attrs="{'readonly':[('state','!=','draft')]}"
103                                                             on_change="onchange_planned(planned_hours,effective_hours)"/>
104                                                         <field name="remaining_hours" widget="float_time" attrs="{'readonly':[('state','!=','draft')]}"/>
105                                                         <button name="%(project.action_config_compute_remaining)d" string="Review" type="action" colspan="1" target="new" states="open,pending" icon="gtk-edit"/>
106                                                     </group>
107                                                     <field colspan="4" name="description" nolabel="1"  attrs="{'readonly':[('state','=','done')]}" widget="text_wiki"/>
108                                                     <group col="11" colspan="4">
109                                                         <field name="state" select="1"/>
110                                                         <button name="do_draft" states="open" string="Draft" type="object" icon="gtk-indent"/>
111                                                         <button name="do_open" states="pending,draft" string="Start Task" type="object" icon="gtk-execute"/>
112                                                         <button name="do_reopen" states="done,cancelled" string="Reactivate" type="object" icon="gtk-convert"/>
113                                                         <button name="do_pending" states="open" string="Pending" type="object" icon="gtk-media-pause"/>
114                                                         <button groups="base.group_extended" name="%(project.action_project_task_delegate)d" states="pending,open" string="Delegate" type="action" icon="gtk-sort-descending"/>
115                                                         <button name="%(project.action_project_close_task)d" states="pending,open" string="Done" type="action" icon="gtk-jump-to"/>
116                                                         <button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel"/>
117
118                                                     </group>
119                                                  </page>
120                                                 <page groups="base.group_extended" string="Extra Info" attrs="{'readonly':[('state','=','done')]}">
121                                                     <group colspan="2" col="2">
122                                                         <field name="priority"/>
123                                                         <field name="sequence"/>
124                                                     </group>
125                                                 <separator string="Miscelleanous" colspan="4"/>
126                                                     <field name="type_id"/>
127                                                     <field name="active"/>
128                                                     <field name="partner_id"/>
129                                                     <separator colspan="4" string="Notes"/>
130                                                     <field colspan="4" name="notes" nolabel="1"/>
131                                                 </page>
132                                             </notebook>
133                                         </form>
134                                     </field>
135                                     <separator string="Notes" colspan="4" />
136                                     <field name="note" colspan="4"
137                                         nolabel="1" />
138                                 </form>
139                             </field>
140                         </page>
141                     </notebook>
142                     <group col="6" colspan="4">
143                         <field name="state" select="1"
144                             readonly="1" />
145                         <button name="action_open" states="draft"
146                             string="Open" type="object" icon="gtk-yes" />
147                         <button name="action_done" states="open"
148                             string="Done" type="object" icon="gtk-jump-to" />
149                         <button name="action_cancel" states="draft,open"
150                             string="Cancel" type="object" icon="gtk-cancel" />
151                         <button name="action_draft" states="done,cancel"
152                             string="Reset to Draft" type="object" icon="gtk-convert" />
153                     </group>
154                 </form>
155             </field>
156         </record>
157
158         <record id="account_analytic_planning_view_search" model="ir.ui.view">
159             <field name="name">report.account.analytic.planning.search</field>
160             <field name="model">report_account_analytic.planning</field>
161             <field name="type">search</field>
162             <field name="arch" type="xml">
163                 <search string="Planning by Account">
164                     <group col="8" colspan="4">
165                         <filter icon="terp-check" string="Current Plannings" domain="[('date_from','&lt;=',time.strftime('%%Y-%%m-%%d')),('date_to','&gt;=',time.strftime('%%Y-%%m-%%d'))]" help="Current Plannings"/>
166                         <separator orientation="vertical"/>
167                         <field name="name"/>
168                         <field name="code"/>
169                         <field name="user_id"/>
170                         <field name="state"/>
171                     </group>
172                 </search>
173             </field>
174         </record>
175
176         <!-- Planning Line -->
177
178         <record id="account_analytic_planning_line_view_tree" model="ir.ui.view">
179             <field name="name">report.account.analytic.planning.line.tree</field>
180             <field name="model">report_account_analytic.planning.line</field>
181             <field name="type">tree</field>
182             <field name="arch" type="xml">
183                 <tree string="Planning Line">
184                     <field name="planning_id"/>
185                     <field name="user_id"/>
186                     <field name="account_id" />
187                     <field name="amount" />
188                     <field name="amount_unit" />
189                     <field name="note" select="1"/>
190                     <field name="amount_in_base_uom" invisible="1" sum="Total Planned (in Days)"/>
191                 </tree>
192             </field>
193         </record>
194
195         <record id="account_analytic_planning_line_view_form" model="ir.ui.view">
196             <field name="name">report.account.analytic.planning.line.form</field>
197             <field name="model">report_account_analytic.planning.line</field>
198             <field name="type">form</field>
199             <field name="arch" type="xml">
200                 <form string="Planning Line">
201                     <field name="planning_id" select="1"/>
202                     <field name="user_id" select="1"/>
203                     <field name="account_id" select="1"/>
204                     <field name="amount" />
205                     <field name="amount_unit" />
206                     <separator string="Notes" colspan="4" />
207                     <field name="note" colspan="4" nolabel="1" />
208                 </form>
209             </field>
210         </record>
211
212         <record id="action_account_analytic_planning_form" model="ir.actions.act_window">
213             <field name="name">Plannings</field>
214             <field name="res_model">report_account_analytic.planning</field>
215             <field name="view_type">form</field>
216             <field name="view_mode">tree,form</field>
217             <field name="context">{"search_default_user_id":uid}</field>
218             <field name="search_view_id" ref="account_analytic_planning_view_search"/>
219             <field name="help">With its commun system for scheduling all resources of a company (people and materials), OpenERP allows you to encode then compute automatically tasks and phases scheduling, track resources allocation and availibility.</field>
220         </record>
221 <!--        <menuitem id="base.menu_pm_planning" name="Planning" parent="base.menu_main_pm" sequence="5"/>-->
222         <menuitem id="base.menu_project_long_term" name="Long Term Planning"
223             parent="base.menu_main_pm" />
224
225         <menuitem action="action_account_analytic_planning_form"
226             id="menu_report_account_analytic_planning" parent="base.menu_project_long_term" sequence="3" groups="project.group_project_user"/>
227
228         <!--
229             Planning statistics
230         -->
231         <record id="account_analytic_planning_stat_view_form" model="ir.ui.view">
232             <field name="name">report.account.analytic.planning.stat.form</field>
233             <field name="model">report_account_analytic.planning.stat</field>
234             <field name="type">form</field>
235             <field name="arch" type="xml">
236                 <form string="Planning statistics">
237                     <field name="planning_id" select="1" />
238                     <field name="user_id" select="1" />
239                     <field name="account_id" select="1" />
240                 </form>
241             </field>
242         </record>
243
244
245         <record id="account_analytic_planning_stat_view_tree" model="ir.ui.view">
246             <field name="name">report.account.analytic.planning.stat.tree</field>
247             <field name="model">report_account_analytic.planning.stat</field>
248             <field name="type">tree</field>
249             <field name="arch" type="xml">
250                 <tree string="Planning statistics">
251                     <field name="planning_id" />
252                     <field name="user_id" />
253                     <field name="manager_id" />
254                     <field name="account_id" />
255                     <field name="sum_amount" />
256                     <field name="sum_amount_real" />
257                     <field name="sum_amount_tasks" />
258                 </tree>
259             </field>
260         </record>
261
262         <record id="account_analytic_planning_stat_view_graph" model="ir.ui.view">
263             <field name="name">report.account.analytic.planning.stat.graph</field>
264             <field name="model">report_account_analytic.planning.stat</field>
265             <field name="type">graph</field>
266             <field name="arch" type="xml">
267                 <graph string="Planning statistics" type="bar">
268                     <field name="account_id" />
269                     <field name="sum_amount" operator="+" />
270                     <field name="sum_amount_real" operator="+" />
271                     <field name="sum_amount_tasks" operator="+" />
272                 </graph>
273             </field>
274         </record>
275
276         <record id="account_analytic_planning_stat_view_search" model="ir.ui.view">
277             <field name="name">report_account_analytic.planning.stat.search</field>
278             <field name="model">report_account_analytic.planning.stat</field>
279             <field name="type">search</field>
280             <field name="arch" type="xml">
281                 <search string="Planning statistics">
282                     <group col="10" colspan="4">
283                         <filter icon="gtk-execute" string="My" domain="[('user_id','=',uid),('planning_id.state','&lt;&gt;','cancel')]" help="My Plannings Statistics"/>
284                         <filter icon="gtk-execute" string="My Project" domain="[('manager_id','=',uid),('planning_id.state','&lt;&gt;','cancel')]" help="Planning Statistics of My Projects"/>
285                         <separator orientation="vertical"/>
286                         <field name="planning_id" select="1"/>
287                         <field name="user_id" select="1"/>
288                         <field name="account_id" select="1"/>
289                     </group>
290                 </search>
291             </field>
292         </record>
293
294
295         <record id="action_account_analytic_planning_stat_form" model="ir.actions.act_window">
296             <field name="name">Planning Statistics</field>
297             <field name="res_model">report_account_analytic.planning.stat</field>
298             <field name="view_type">form</field>
299             <field name="view_mode">graph,tree</field>
300             <field name="search_view_id" ref="account_analytic_planning_stat_view_search"/>
301         </record>
302         <menuitem id="next_id_85" name="Planning"
303             parent="hr.menu_hr_reporting" />
304         <menuitem action="action_account_analytic_planning_stat_form"
305             id="menu_report_account_analytic_planning_stat" parent="next_id_85" />
306
307 <!--        Analytic account Form -->
308
309         <record id="view_project_planning_form" model="ir.ui.view">
310             <field name="name">planning.account.analytic.account.form</field>
311             <field name="model">account.analytic.account</field>
312             <field name="type">form</field>
313             <field name="inherit_id" ref="account.view_account_analytic_account_form"/>
314             <field name="arch" type="xml">
315                 <notebook position="inside">
316                     <page string="Planning" >
317                         <separator string="Planning lines"/>
318                         <field name="planning_ids" colspan="4" nolabel="1">
319                             <form string="Planning Lines">
320                                 <field name="planning_id" select="1"/>
321                                 <field name="user_id"/>
322                                 <field name="amount" />
323                                 <field name="amount_unit" />
324                                 <separator string="Notes" colspan="4" />
325                                 <field name="note" colspan="4" nolabel="1" />
326                             </form>
327                             <tree editable="bottom"
328                                     string="Planning Lines">
329                                     <field name="user_id"/>
330                                     <field name="account_id" />
331                                     <field name="amount" />
332                                     <field name="amount_unit" />
333                                     <field name="task_ids" />
334                                     <field name="note" />
335                                     <field name="amount_in_base_uom" invisible="1" sum="Total Planned (in Days)"/>
336                                 </tree>
337                         </field>
338                     </page>
339                 </notebook>
340             </field>
341         </record>
342
343
344 <!--        Task Form -->
345
346         <record id="view_task_planning_form" model="ir.ui.view">
347             <field name="name">planning.task.form</field>
348             <field name="model">project.task</field>
349             <field name="type">form</field>
350             <field name="inherit_id" ref="project.view_task_form2"/>
351             <field name="arch" type="xml">
352                 <field name="priority" position="before">
353                     <field name="planning_line_id" domain="['|', ('user_id','=',user_id), ('user_id','=', False)]"/>
354                 </field>
355             </field>
356         </record>
357
358 <!--Added link to open the list of all tasks planned on all lines of this planning.-->
359         <act_window context="{'planning': active_id}"
360             id="act_task_of_lines" name="Tasks" res_model="project.task"
361             src_model="report_account_analytic.planning"
362         />
363
364         <!-- company form -->
365         <record id="planning_company" model="ir.ui.view">
366             <field name="name">res.company.planning.config</field>
367             <field name="model">res.company</field>
368             <field name="type">form</field>
369             <field name="priority">25</field>
370             <field name="inherit_id" ref="base.view_company_form"/>
371             <field name="arch" type="xml">
372                 <field name="project_time_mode_id" position="after">
373                 <field name="planning_time_mode_id"/>
374             </field>
375             </field>
376         </record>
377
378     </data>
379 </openerp>