[IMP] hr_timesheet, project: various usability-related improvements
[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         <record model="ir.ui.view" id="project_issue_version_search_view">
8             <field name="name">Issue Version</field>
9             <field name="model">project.issue.version</field>
10             <field name="arch" type="xml">
11                 <search string="Issue Version">
12                     <field name="name" string="Issue Version"/>
13                     <field name="active"/>
14                 </search>
15             </field>
16         </record>
17         <record model="ir.ui.view" id="project_issue_version_form_view">
18             <field name="name">Issue Version</field>
19             <field name="model">project.issue.version</field>
20             <field name="arch" type="xml">
21                 <form string="Issue Version">
22                     <group col="2">
23                         <field name="name"/>
24                         <field name="active"/>
25                     </group>
26                 </form>
27             </field>
28         </record>
29         <record id="project_issue_version_action" model="ir.actions.act_window">
30             <field name="name">Versions</field>
31             <field name="res_model">project.issue.version</field>
32             <field name="view_type">form</field>
33             <field name="help" type="html">
34               <p class="oe_view_nocontent_create">
35                 Click to add a new version.
36               </p><p>
37                 Define here the different versions of your products on which
38                 you can work on issues.
39               </p>
40             </field>
41         </record>
42         <menuitem action="project_issue_version_action" id="menu_project_issue_version_act" parent="menu_project_confi" groups="base.group_no_one"/>
43
44
45         <record model="ir.ui.view" id="project_issue_form_view">
46             <field name="name">Project Issue Tracker Form</field>
47             <field name="model">project.issue</field>
48             <field name="arch" type="xml">
49                 <form string="Issue">
50                 <header>
51                     <field name="stage_id" widget="statusbar" clickable="True"
52                         options="{'fold_field': 'fold'}"/>
53                 </header>
54                 <sheet string="Issue">
55                     <div class="oe_right">
56                         <field name="kanban_state" class="oe_inline" widget="kanban_state_selection"/>
57                     </div>
58                     <label for="name" class="oe_edit_only"/>
59                     <h1>
60                         <field name="name" class="oe_inline"/>
61                     </h1>
62                     <label for="categ_ids" class="oe_edit_only"/>
63                     <field name="categ_ids" widget="many2many_tags"/>
64                     <group>
65                         <group>
66                             <field name="user_id"
67                                 context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'project.group_project_user']}"/>
68                             <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
69                             <field name="email_from"/>
70                             <label for="project_id"/>
71                             <div>
72                                 <field name="project_id" on_change="on_change_project(project_id)" class="oe_inline" context="{'default_use_issues':1}"/>
73                                 <field name="can_escalate" invisible="1"/>
74                                 <button name="case_escalate" string="Escalate" type="object" class="oe_link" attrs="{'invisible':[('can_escalate','=',False)]}" groups="base.group_user"/>
75                             </div>
76                         </group>
77                         <group>
78                             <field name="id"/>
79                             <field name="version_id" groups="base.group_user"/>
80                             <field name="priority" groups="base.group_user" widget="priority"/>
81                             <label for="task_id" groups="base.group_user"/>
82                             <div groups="base.group_user">
83                                 <field name="task_id" on_change="onchange_task_id(task_id)" class="oe_inline" context="{'default_project_id':project_id}"/>
84                                 <field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}" class="oe_inline"/>
85                             </div>
86                         </group>
87                     </group>
88                     <notebook>
89                         <page string="Description">
90                             <field name="description" placeholder="Add an internal note..." groups="base.group_user"/>
91                         </page>
92                         <page string="Extra Info" groups="project.group_project_manager,project.group_project_user">
93                             <group>
94                                 <group string="Statistics">
95                                     <field name="day_open"/>
96                                     <field name="day_close"/>
97                                     <field name="working_hours_open" widget="float_time"/>
98                                     <field name="working_hours_close" widget="float_time"/>
99                                     <field name="inactivity_days"/>
100                                     <field name="days_since_creation"/>
101                                 </group>
102                                 <group string="Status" groups="base.group_no_one">
103                                     <field name="active"/>
104                                 </group>
105                             </group>
106                         </page>
107                     </notebook>
108                 </sheet>
109                 <div class="oe_chatter">
110                     <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
111                     <field name="message_ids" widget="mail_thread"/>
112                 </div>
113                 </form>
114             </field>
115         </record>
116
117         <record model="ir.ui.view" id="project_issue_tree_view">
118             <field name="name">Project Issue Tracker Tree</field>
119             <field name="model">project.issue</field>
120             <field name="arch" type="xml">
121                 <tree string="Issue Tracker Tree" fonts="bold:message_unread==True">
122                     <field name="message_unread" invisible="1"/>
123                     <field name="id"/>
124                     <field name="name"/>
125                     <field name="partner_id"/>
126                     <field name="project_id"/>
127                     <field name="priority" string="Priority" groups="base.group_user"/>
128                     <field name="create_date"/>
129                     <field name="version_id" widget="selection"/>
130                     <field name="user_id"/>
131                     <field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/>
132                     <field name="stage_id" widget="selection" readonly="1"/>
133                     <field name="categ_ids" invisible="1"/>
134                     <field name="task_id" invisible="1"/>
135                 </tree>
136             </field>
137         </record>
138
139         <record id="view_project_issue_filter" model="ir.ui.view">
140             <field name="name">Project Issue Tracker Search</field>
141             <field name="model">project.issue</field>
142             <field name="arch" type="xml">
143                 <search string="Issue Tracker Search">
144                     <field name="name" string="Issue" filter_domain="['|', '|', '|', ('partner_id','child_of',self), ('description','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
145                     <field name="id"/>
146                     <field name="partner_id" operator="child_of"/>
147                     <field name="user_id"/>
148                     <field name="project_id"/>
149                     <field name="categ_ids"/>
150                     <field name="stage_id" domain="[]"/>
151                     <filter string="My Issues" domain="[('user_id','=',uid)]"/>
152                     <filter string="Unassigned" name="unassigned" domain="[('user_id', '=', False)]"/>
153                     <separator/>
154                     <filter string="New" name="draft" domain="[('stage_id.sequence', '=', 1)]"/>
155                     <separator/>
156                     <filter string="New Mail" name="message_unread" domain="[('message_unread','=',True)]"/>
157                     <group expand="0" string="Group By" >
158                         <filter string="Assigned to" name="Responsible" context="{'group_by':'user_id'}" />
159                         <filter string="Project" name="project" context="{'group_by':'project_id'}" />
160                         <filter string="Task" context="{'group_by':'task_id'}"/>
161                         <filter string="Priority" context="{'group_by':'priority'}" />
162                         <filter string="Stage" context="{'group_by':'stage_id'}"/>
163                         <filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
164                         <separator/>
165                         <filter string="Create Day" context="{'group_by':'create_date:day'}" help="Create Date"/>
166                         <filter string="Last Message" name="group_message_last_post" context="{'group_by':'message_last_post:week'}"/>
167                     </group>
168                 </search>
169             </field>
170         </record>
171
172         <record model="ir.ui.view" id="project_issue_calendar_view">
173             <field name="name">Project Issue Tracker Calendar</field>
174             <field name="model">project.issue</field>
175             <field name="priority" eval="2"/>
176             <field name="arch" type="xml">
177                 <calendar string="Issues" date_start="date" color="user_id" date_delay="duration">
178                     <field name="name"/>
179                     <field name="partner_id"/>
180                 </calendar>
181             </field>
182         </record>
183
184
185         <!-- Project Issue Karban View-->
186
187         <record model="ir.ui.view" id="project_issue_kanban_view">
188             <field name="name">Project Issue Kanban</field>
189             <field name="model">project.issue</field>
190             <field name="arch" type="xml">
191                 <kanban default_group_by="stage_id">
192                     <field name="stage_id"/>
193                     <field name="color"/>
194                     <field name="priority"/>
195                     <field name="user_email"/>
196                     <field name="user_id"/>
197                     <field name="date_deadline"/>
198                     <field name="kanban_state"/>
199                     <field name="message_summary"/>
200                     <templates>
201                         <t t-name="kanban-tooltip">
202                            <ul class="oe_kanban_tooltip">
203                               <li><b>Project:</b> <field name="project_id"/></li>
204                               <li><b>Category:</b> <field name="categ_ids"/></li>
205                            </ul>
206                         </t>
207                         <t t-name="kanban-box">
208                             <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click oe_semantic_html_override">
209                                 <div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
210                                     <span class="oe_e">i</span>
211                                     <ul class="oe_dropdown_menu">
212                                         <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
213                                         <t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
214                                         <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
215                                     </ul>
216                                 </div>
217                                 <div class="oe_kanban_content" tooltip="kanban-tooltip">
218                                     <div>
219                                         <b><field name="name"/></b> <br/>
220                                         <field name="partner_id"/> <br/>
221                                         <field name="version_id"/>
222                                     </div>
223                                     <div class="oe_kanban_bottom_right">
224                                         <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 pull-right"/>
225                                         <div class="pull-left" groups="base.group_user">
226                                             <field name="kanban_state" widget="kanban_state_selection"/>
227                                             <field name="priority" widget="priority"/>
228                                         </div>
229                                     </div>
230                                     <div class="oe_kanban_footer_left">
231                                         <field name="categ_ids"/>
232                                         <t t-raw="record.message_summary.raw_value"/>
233                                     </div>
234                                 </div>
235                                 <div class="oe_clear"></div>
236                             </div>
237                         </t>
238                     </templates>
239                 </kanban>
240             </field>
241         </record>
242
243         <record model="ir.ui.view" id="project_issue_graph_view">
244             <field name="name">Project Issue Tracker Graph</field>
245             <field name="model">project.issue</field>
246             <field name="arch" type="xml">
247                 <graph string="Project Issues" type="bar">
248                     <field name="project_id" type="row"/>
249                     <field name="create_date" interval="month" type="col"/>
250                 </graph>
251             </field>
252         </record>
253
254
255         <!-- Feature Requests -->
256         <record model="ir.ui.view" id="project_feature_tree_view">
257             <field name="name">Project Issue- Feature Tracker Tree</field>
258             <field name="model">project.issue</field>
259             <field name="arch" type="xml">
260                 <tree string="Feature Tracker Tree" fonts="bold:message_unread==True">
261                     <field name="id"/>
262                     <field name="message_unread" invisible="1"/>
263                     <field name="name" string="Feature description"/>
264                     <field name="partner_id"/>
265                     <field name="priority" string="Priority"/>
266                     <field name="version_id"/>
267                     <field name="user_id"/>
268                     <field name="stage_id" widget="selection" readonly="1"/>
269                 </tree>
270             </field>
271         </record>
272
273         <record id="act_project_project_2_project_issue_all" model="ir.actions.act_window">
274             <field name="res_model">project.issue</field>
275             <field name="view_type">form</field>
276             <field name="name">Issues</field>
277             <field name="view_mode">kanban,tree,form,calendar,graph</field>
278             <field name="context">{
279                     'search_default_project_id': [active_id],
280                     'default_project_id': active_id,
281                 }
282             </field>
283             <field name="help" type="html">
284                 <p>
285                     The Odoo issues tacker allows you to efficiantly manage things
286                     like internal requests, software development bugs, customer
287                     complaints, project troubles, material breakdowns, etc.
288                 </p>
289             </field>
290         </record>
291
292         <!-- Project -->
293         <record id="view_project_form_inherited" model="ir.ui.view">
294             <field name="name">project.project.form.inherited</field>
295             <field name="model">project.project</field>
296             <field name="inherit_id" ref="project.edit_project"/>
297             <field name="arch" type="xml">
298                 <xpath expr='//div[@name="options_active"]' position="attributes">
299                     <attribute name="invisible">0</attribute>
300                 </xpath>
301                 <xpath expr='//div[@name="options_active"]' position='inside'>
302                     <field name="use_issues" class="oe_inline"
303                             on_change="on_change_use_tasks_or_issues(use_tasks, use_issues)"/>
304                     <label for="use_issues"/>
305                 </xpath>
306                 <xpath expr='//div[@name="buttons"]' position='inside'>
307                     <button class="oe_inline oe_stat_button" type="action" attrs="{'invisible':[('use_issues','=', False)]}"
308                         name="%(act_project_project_2_project_issue_all)d" icon="fa-bug">
309                         <field string="Issues" name="issue_count" widget="statinfo"/>
310                     </button>
311                 </xpath>
312                 <xpath expr='//page[@name="project_stages"]' position="attributes">
313                     <attribute name="attrs">{'invisible': [('use_tasks', '=', False),('use_issues','=',False)]}</attribute>
314                 </xpath>
315                 <xpath expr='//field[@name="use_tasks"]' position="attributes">
316                     <attribute name="attrs">{'on_change': 'on_change_use_tasks_or_issues(use_tasks, use_issues)'}</attribute>
317                 </xpath>
318                 <field name="sequence" position="before">
319                     <field name="project_escalation_id"/>
320                 </field>
321             </field>
322        </record>
323
324         <record id="view_project_kanban_inherited" model="ir.ui.view">
325             <field name="name">project.project.kanban.inherited</field>
326             <field name="model">project.project</field>
327             <field name="inherit_id" ref="project.view_project_kanban"/>
328             <field name="arch" type="xml">
329                 <field name="use_tasks" position="after">
330                     <field name="use_issues"/>
331                     <field name="issue_ids" invisible="1"/>
332                 </field>
333                 <xpath expr="//div[contains(@class, 'oe_kanban_project_list')]/a" position="after">
334                     <a t-if="record.use_issues.raw_value" style="margin-right: 10px"
335                         name="%(act_project_project_2_project_issue_all)d" type="action">
336                         <t t-raw="record.issue_ids.raw_value.length"/> Issues
337                     </a>
338                 </xpath>
339                 <xpath expr="//div[contains(@class, 'oe_kanban_project_list')]/div" position="replace">
340                      <div t-if="!(record.use_tasks.raw_value and record.task_count.raw_value gt 0) and !(record.use_issues.raw_value and record.issue_ids.raw_value.length gt 0)" style="margin-top: 6px;margin-left:20px;">
341                          <img src="/project/static/src/img/top_left_arrow.png" style="margin-top: -8px; width: 22px;" />
342                          <span>No activity yet, click to enter in the project.</span>
343                      </div>
344                 </xpath>
345             </field>
346         </record>
347
348         <record id="analytic_account_inherited_issue_form" model="ir.ui.view">
349             <field name="name">account.analytic.account.issue.form.inherit</field>
350             <field name="model">account.analytic.account</field>
351             <field name="inherit_id" ref="project.analytic_account_inherited_form"/>
352             <field eval="18" name="priority"/>
353             <field name="arch" type="xml">
354                 <xpath expr='//div[@name="project"]' position='inside'>
355                     <field name="use_issues"/>
356                     <label for="use_issues"/>
357                 </xpath>
358             </field>
359         </record>
360
361         <record id="action_view_issues" model="ir.actions.act_window">
362             <field name="res_model">project.issue</field>
363             <field name="view_type">form</field>
364             <field name="name">Issues</field>
365             <field name="view_mode">kanban,tree,form,calendar,graph</field>
366             <field name="help" type="html">
367                 <p>
368                     The Odoo issues tacker allows you to efficiantly manage things
369                     like internal requests, software development bugs, customer
370                     complaints, project troubles, material breakdowns, etc.
371                 </p>
372             </field>
373         </record>
374
375         <!-- res.partner -->
376         <record model="ir.ui.view" id="res_partner_issues_button_view">
377             <field name="name">res.partner.issues.button.view</field>
378             <field name="model">res.partner</field>
379             <field name="inherit_id" ref="base.view_partner_form" />
380             <field name="priority" eval="50"/>
381             <field name="arch" type="xml">
382                 <xpath expr="//div[@name='buttons']" position="inside">
383                     <button class="oe_inline oe_stat_button" type="action" name="%(action_view_issues)d"
384                         context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}"
385                         attrs="{'invisible': [('customer', '=', False)]}"
386                         icon="fa-bug" groups="project.group_project_user">
387                         <field  string="Issues" name="issue_count" widget="statinfo"/>
388                     </button>
389
390
391                 </xpath>
392             </field>
393         </record>
394
395     </data>
396 </openerp>