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