merge lp:openobject-addons
[odoo/odoo.git] / addons / project_issue / project_issue_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5         <menuitem  id="menu_project_confi" name="Issues" parent="base.menu_definitions" sequence="2"/>
6
7         <!-- Project issue Read/Unread actions -->
8         <record id="actions_server_project_issue_unread" model="ir.actions.server">
9             <field name="name">Mark unread</field>
10             <field name="condition">True</field>
11             <field name="type">ir.actions.server</field>
12             <field name="model_id" ref="model_project_issue"/>
13             <field name="state">code</field>
14             <field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
15         </record>
16         <record id="action_project_issue_unread" model="ir.values">
17             <field name="name">action_project_issue_unread</field>
18             <field name="action_id" ref="actions_server_project_issue_unread"/>
19             <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_project_issue_unread'))"/>
20             <field name="key">action</field>
21             <field name="model_id" ref="model_project_issue"/>
22             <field name="model">project.issue</field>
23             <field name="key2">client_action_multi</field>
24         </record>
25
26         <record id="actions_server_project_issue_read" model="ir.actions.server">
27             <field name="name">Mark read</field>
28             <field name="condition">True</field>
29             <field name="type">ir.actions.server</field>
30             <field name="model_id" ref="model_project_issue"/>
31             <field name="state">code</field>
32             <field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
33         </record>
34         <record id="action_project_issue_read" model="ir.values">
35             <field name="name">action_project_issue_read</field>
36             <field name="action_id" ref="actions_server_project_issue_read"/>
37             <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_project_issue_read'))"/>
38             <field name="key">action</field>
39             <field name="model_id" ref="model_project_issue"/>
40             <field name="model">project.issue</field>
41             <field name="key2">client_action_multi</field>
42         </record>
43
44         <record model="ir.ui.view" id="project_issue_version_search_view">
45             <field name="name">Issue Version</field>
46             <field name="model">project.issue.version</field>
47             <field name="type">search</field>
48             <field name="arch" type="xml">
49                 <search string="Issue Version">
50                     <field name="name" string="Issue Version"/>
51                     <field name="active"/>
52                 </search>
53             </field>
54         </record>
55         <record model="ir.ui.view" id="project_issue_version_form_view">
56             <field name="name">Issue Version</field>
57             <field name="model">project.issue.version</field>
58             <field name="type">form</field>
59             <field name="arch" type="xml">
60                 <form string="Issue Version" version="7.0">
61                     <group col="2">
62                         <field name="name"/>
63                         <field name="active"/>
64                     </group>
65                 </form>
66             </field>
67         </record>
68         <record id="project_issue_version_action" model="ir.actions.act_window">
69             <field name="name">Versions</field>
70             <field name="res_model">project.issue.version</field>
71             <field name="view_type">form</field>
72             <field name="help" type="html">
73               <p class="oe_view_nocontent_create">
74                 Click to add a new version.
75               </p><p>
76                 Define here the different versions of your products on which
77                 you can work on issues.
78               </p>
79             </field>
80         </record>
81         <menuitem action="project_issue_version_action" id="menu_project_issue_version_act" parent="menu_project_confi" groups="base.group_no_one"/>
82
83         <record id="project_issue_categ_action" model="ir.actions.act_window">
84             <field name="name">Issue Categories</field>
85             <field name="res_model">crm.case.categ</field>
86             <field name="view_type">form</field>
87             <field name="view_id" ref="crm.crm_case_categ_tree-view"/>
88             <field name="domain">[('object_id.model', '=', 'project.issue')]</field>
89             <field name="context" eval="{'object_id': ref('model_project_issue')}"/>
90         </record>
91
92         <menuitem action="project_issue_categ_action" name="Categories" id="menu_project_issue_category_act" parent="menu_project_confi" groups="base.group_no_one"/>
93
94         <record model="ir.ui.view" id="project_issue_form_view">
95             <field name="name">Project Issue Tracker Form</field>
96             <field name="model">project.issue</field>
97             <field name="type">form</field>
98             <field name="arch" type="xml">
99                 <form string="Issue" version="7.0">
100                 <header>
101                     <span groups="base.group_user">
102                         <button name="case_open" string="Open" type="object"
103                                 states="draft,pending" class="oe_highlight"/>
104                         <button name="case_close" string="Done" type="object"
105                                 states="open"/>
106                          <button name="case_close" string="Done" type="object"
107                                 states="draft,pending"/>
108                         <button name="case_pending" string="Pending" type="object"
109                                 states="draft,open"/>
110                         <button name="case_escalate" string="Escalate" type="object"
111                                 states="draft,open,pending"/>
112                         <button name="case_reset" string="Reset to New" type="object"
113                                 states="cancelled,done"/>
114                         <button name="stage_previous" string="Previous Stage" type="object"
115                                 states="open,pending"
116                                 attrs="{'invisible': [('stage_id','=', False)]}"/>
117                         <button name="stage_next" string="Next Stage" type="object"
118                                 states="open,pending"
119                                 attrs="{'invisible': [('stage_id','=', False)]}"/>
120                         <button name="case_cancel" string="Cancel" type="object"
121                                 states="draft,open,pending"/>
122                     </span>
123                     <field name="stage_id" widget="statusbar"/>
124                 </header>
125                 <sheet string="Issue">
126                     <label for="name" class="oe_edit_only"/>
127                     <h1><field name="name"/></h1>
128                     <group>
129                         <group>
130                             <field name="user_id"/>
131                             <field name="partner_id"  on_change="onchange_partner_id(partner_id, email_from)"/>
132                             <field name="email_from"/>
133                         </group>
134                         <group>
135                             <field name="priority"/>
136                             <field name="project_id" required="True" on_change="on_change_project(project_id)" context="{'default_use_issues':1}"/>
137                             <label for="task_id"/>
138                             <div>
139                                 <field name="task_id" on_change="onchange_task_id(task_id)" class="oe_inline" context="{'default_project_id':project_id}"/>
140                                 <field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}" class="oe_inline"/>
141                             </div>
142                             <field name="categ_ids" widget="many2many_tags"/>
143                         </group>
144                     </group>
145                     <notebook>
146                         <page string="Description">
147                             <group>
148                                 <group>
149                                     <field name="version_id" widget="selection"/>
150                                 </group>
151                             </group>
152                             <field name="description" placeholder="Add a description..."/>
153                         </page>
154                         <page string="Extra Info" groups="base.group_no_one">
155                             <group col="4" colspan="4">
156                                 <separator string="Statistics" colspan="4" col="4"/>
157                                 <field name="day_open"/>
158                                 <field name="day_close"/>
159                                 <field name="working_hours_open" widget="float_time"/>
160                                 <field name="working_hours_close" widget="float_time"/>
161                                 <field name="inactivity_days"/>
162                                 <field name="days_since_creation"/>
163                             </group>
164                             <group colspan="4" col="4">
165                                 <separator string="References" colspan="4"/>
166                                 <field name="id"/>
167                                 <field name="active"/>
168                             </group>
169                             <group colspan="4" col="4">
170                                 <separator string="Status" colspan="4"/>
171                                 <field name="state" groups="base.group_no_one" string="Status"/>
172                             </group>
173                         </page>
174                     </notebook>
175                 </sheet>
176                 <div class="oe_chatter">
177                     <field name="message_ids" widget="mail_thread"/>
178                 </div>
179                 </form>
180             </field>
181         </record>
182
183         <record model="ir.ui.view" id="project_issue_tree_view">
184             <field name="name">Project Issue Tracker Tree</field>
185             <field name="model">project.issue</field>
186             <field name="type">tree</field>
187             <field name="arch" type="xml">
188                 <tree string="Issue Tracker Tree" fonts="bold:needaction_pending==True" colors="black:state=='open';blue:state=='pending';grey:state in ('cancel', 'done')">
189                     <field name="needaction_pending" invisible="1"/>
190                     <field name="id"/>
191                     <field name="create_date" groups="base.group_no_one"/>
192                     <field name="name"/>
193                     <field name="partner_id"/>
194                     <field name="project_id"/>
195                     <field name="priority" string="Priority" groups="base.group_user"/>
196                     <field name="version_id" widget="selection"/>
197                     <field name="user_id"/>
198                     <field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/>
199                     <field name="stage_id" widget="selection" readonly="1"/>
200                     <field name="state" groups="base.group_no_one"/>
201                     <field name="categ_ids" invisible="1"/>
202                     <field name="task_id" invisible="1"/>
203                 </tree>
204             </field>
205         </record>
206
207         <record id="view_project_issue_filter" model="ir.ui.view">
208             <field name="name">Project Issue Tracker Search</field>
209             <field name="model">project.issue</field>
210             <field name="type">search</field>
211             <field name="arch" type="xml">
212                 <search string="Issue Tracker Search">
213                     <field name="name" string="Issue" filter_domain="['|', '|',('partner_id','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
214                     <field name="id"/>
215                     <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="needaction_pending" domain="[('needaction_pending','=',True)]"/>
216                     <separator/>
217                     <filter string="New" icon="terp-document-new" domain="[('state','=','draft')]" help="New Issues"/>
218                     <filter string="To Do" domain="[('state','=','open')]" help="To Do Issues" icon="terp-check"/>
219                     <separator/>
220                     <filter string="Unassigned Issues" domain="[('user_id','=',False)]"  help="Unassigned Issues" icon="terp-personal-" />
221                     <field name="user_id"/>
222                     <field name="project_id"/>
223                     <group expand="0" string="Group By..." >
224                         <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
225                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
226                         <filter string="Project"  icon="terp-folder-violet" domain="[]" context="{'group_by':'project_id'}"/>
227                         <filter string="Version" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'version_id'}"/>
228                         <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}"/>
229                         <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}"/>
230                         <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
231                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
232                         <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" help="Creation Month"/>
233                     </group>
234                 </search>
235             </field>
236         </record>
237
238         <record model="ir.ui.view" id="project_issue_calendar_view">
239             <field name="name">Project Issue Tracker Calendar</field>
240             <field name="model">project.issue</field>
241             <field name="type">calendar</field>
242             <field name="priority" eval="2"/>
243             <field name="arch" type="xml">
244                 <calendar string="Issues" date_start="date" color="user_id" date_delay="duration">
245                     <field name="name"/>
246                     <field name="partner_id"/>
247                 </calendar>
248             </field>
249         </record>
250
251
252         <!-- Project Issue Karban View-->
253
254         <record model="ir.ui.view" id="project_issue_kanban_view">
255             <field name="name">Project Issue Kanban</field>
256             <field name="model">project.issue</field>
257             <field name="type">kanban</field>
258             <field name="arch" type="xml">
259                 <kanban default_group_by="stage_id">
260                     <field name="color"/>
261                     <field name="priority"/>
262                     <field name="user_email"/>
263                     <field name="user_id"/>
264                     <field name="date_deadline"/>
265                     <templates>
266                         <t t-name="kanban-tooltip">
267                            <ul class="oe_kanban_tooltip">
268                               <li><b>Project:</b> <field name="project_id"/></li>
269                               <li><b>Category:</b> <field name="categ_ids"/></li>
270                            </ul>
271                         </t>
272                         <t t-name="kanban-box">
273                             <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
274                                 <div class="oe_dropdown_toggle oe_dropdown_kanban">
275                                     <span class="oe_e">i</span>
276                                     <ul class="oe_dropdown_menu">
277                                         <li><a type="edit" >Edit...</a></li>
278                                         <li><a type="delete">Delete</a></li>
279                                         <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
280                                     </ul>
281                                 </div>
282                                 <div class="oe_kanban_content" tooltip="kanban-tooltip">
283                                     <div>
284                                         <b><field name="name"/></b> <br/>
285                                         <field name="partner_id"/> <br/>
286                                         <field name="version_id"/>
287                                     </div>
288                                     <div class="oe_kanban_footer_left">
289                                         <div class="oe_left oe_tags">
290                                             <t t-foreach="record.categ_ids.raw_value" t-as="categ_id">
291                                                 <span class="oe_tag" t-att-data-categ_id="categ_id"></span>
292                                             </t>
293                                         </div>
294                                         <div class="oe_right">
295                                             <span class="oe_kanban_highlight">
296                                                 <t t-set="priority" t-value="record.priority.raw_value || 5"/>
297                                                 <a type="object" name="set_priority" args="['3']" t-if="priority gt 3" title="Normal Priority">
298                                                    <img src="/web/static/src/img/icons/star-off.png" width="16" height="16"/>
299                                                 </a>
300                                                 <a type="object" name="set_priority" args="['5']" t-if="priority lte 3" title="Normal Priority">
301                                                    <img t-attf-src="/web/static/src/img/icons/star-#{priority lte 3 ? 'on' : 'off'}.png" width="16" height="16"/>
302                                                 </a>
303                                                 <a type="object" name="set_priority" args="['2']" title="High Priority">
304                                                    <img t-attf-src="/web/static/src/img/icons/star-#{priority lte 2 ? 'on' : 'off'}.png" width="16" height="16"/>
305                                                 </a>
306                                                 <a type="object" name="set_priority" args="['1']" title="Highest Priority">
307                                                    <img t-attf-src="/web/static/src/img/icons/star-#{priority == 1 ? 'on' : 'off'}.png" width="16" height="16"/>
308                                                 </a>
309                                             </span>
310                                             <t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())">
311                                                 <span t-attf-class="oe_kanban_status oe_kaban_status_red"> </span>
312                                             </t>
313                                             <img t-att-src="kanban_image('res.users', 'avatar', record.user_id.raw_value[0])" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
314                                         </div>
315                                     </div>
316                                 </div>
317                                 <div class="oe_clear"></div>
318                             </div>
319                         </t>
320                     </templates>
321                 </kanban>
322             </field>
323         </record>
324
325
326         <!-- Feature Requests -->
327         <record model="ir.ui.view" id="project_feature_tree_view">
328             <field name="name">Project Issue- Feature Tracker Tree</field>
329             <field name="model">project.issue</field>
330             <field name="type">tree</field>
331             <field name="arch" type="xml">
332                 <tree string="Feature Tracker Tree" fonts="bold:needaction_pending==True" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
333                     <field name="id"/>
334                     <field name="needaction_pending" invisible="1"/>
335                     <field name="name" string="Feature description"/>
336                     <field name="partner_id"/>
337                     <field name="priority" string="Priority"/>
338                     <field name="version_id"/>
339                     <field name="user_id"/>
340                     <field name="stage_id" widget="selection" readonly="1"/>
341                     <field name="state" groups="base.group_no_one"/>
342                 </tree>
343             </field>
344         </record>
345
346         <record id="view_project_feature_filter" model="ir.ui.view">
347             <field name="name">Project Issue - Feature Tracker Search</field>
348             <field name="model">project.issue</field>
349             <field name="type">search</field>
350             <field name="arch" type="xml">
351                 <search string="Feature Tracker Search">
352                     <field name="name" string="Feature description"/>
353                     <field name="date"/>
354                     <field name="state" groups="base.group_no_one"/>
355                     <filter icon="terp-check" domain="[('state','in',('open','draft'))]" help="Current Features" name="current_feature"/>
356                     <filter icon="terp-camera_test" domain="[('state','=','open')]" help="Open Features"/>
357                     <field name="user_id"/>
358                     <field name="project_id" string="Project"/>
359                 </search>
360             </field>
361         </record>
362
363         <act_window id="act_project_project_2_project_issue_all"
364             name="Issues"
365             src_model="project.project"
366             res_model="project.issue"
367             view_type="form"
368             view_mode="kanban,tree,form,calendar,graph"
369             context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"/>
370
371         <!-- Project -->
372         <record id="view_project_form_inherited" model="ir.ui.view">
373             <field name="name">project.project.form.inherited</field>
374             <field name="model">project.project</field>
375             <field name="type">form</field>
376             <field name="inherit_id" ref="project.edit_project"/>
377             <field name="arch" type="xml">
378                 <xpath expr='//tr[@name="use_tasks_row"]' position='after'>
379                     <tr>
380                         <td><group><field name="use_issues"/></group></td>
381                         <td><button icon="terp-gtk-go-back-rtl" name="%(act_project_project_2_project_issue_all)d" string="Issues" type="action" attrs="{'invisible':[('use_issues','=', 0)]}"/></td>
382                     </tr>
383                 </xpath>
384                 <field name="priority" position="before">
385                     <field name="project_escalation_id"/>
386                 </field>
387                 <field name="alias_domain" position="after">
388                     <label for="alias_model" class="oe_edit_only" string="creates"/><field name="alias_model" class="oe_edit_only oe_inline"/>
389                 </field>
390             </field>
391        </record>
392
393         <record id="view_project_kanban_inherited" model="ir.ui.view">
394             <field name="name">project.project.kanban.inherited</field>
395             <field name="model">project.project</field>
396             <field name="type">kanban</field>
397             <field name="inherit_id" ref="project.view_project_kanban"/>
398             <field name="arch" type="xml">
399                 <field name="use_tasks" position="after">
400                     <field name="use_issues"/>
401                     <field name="issue_count" invisible="1"/>
402                 </field>
403                 <xpath expr="//div[contains(@class, 'oe_kanban_project_list')]" position="inside">
404                     <a t-if="record.use_issues.raw_value"
405                         name="%(act_project_project_2_project_issue_all)d" type="action">
406                         Issues(<field name="issue_count"/>)</a>
407                 </xpath>
408             </field>
409         </record>
410
411         <record id="analytic_account_inherited_issue_form" model="ir.ui.view">
412             <field name="name">account.analytic.account.issue.form.inherit</field>
413             <field name="model">account.analytic.account</field>
414             <field name="type">form</field>
415             <field name="inherit_id" ref="project.analytic_account_inherited_form"/>
416             <field eval="18" name="priority"/>
417             <field name="arch" type="xml">
418                 <xpath expr='//separator[@name="project_sep"]' position='replace'>
419                     <separator colspan="4" string="Project Management" name="project_sep"/> <!-- removal of invisible attribute -->
420                 </xpath>
421                 <xpath expr='//separator[@name="project_sep"]' position='after'>
422                     <field name="use_issues"/>
423                 </xpath>
424             </field>
425         </record>
426
427     </data>
428 </openerp>