Skip to content

Commit

Permalink
[IMP] Improve UI for workflow task
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpeiffer committed Sep 20, 2016
1 parent 7cc9248 commit 3768e23
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions workflow_task/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ def _dummy_compute(self):
for record in self:
record.ref_object_name = record.ref_object

@api.multi
def open_object(self):
self.ensure_one()
obj = self.env[self.res_type].browse([self.res_id])
act = obj.get_formview_action()
if isinstance(act, list) and len(act) == 1:
act = act[0]
return act

@api.multi
def _get_action_ids(self):
for record in self:
Expand Down
8 changes: 6 additions & 2 deletions workflow_task/views/wkf_task_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<field name="model">workflow.task</field>
<field name="arch" type="xml">
<tree create="0" colors="grey:state == 'closed';red:date_critical and date_critical &lt;= current_date;black:state == 'started';blue:state == 'new'">
<button name="open_object" type="object" icon="gtk-open" />
<field name="ref_object" />
<field name="name" />
<field name="state" />
Expand All @@ -84,13 +85,16 @@
</record>

<record id="open_workflow_task" model="ir.actions.act_window">
<field name="name">Workflow Tasks</field>
<field name="name">Tasks</field>
<field name="res_model">workflow.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_not_closed': 1}</field>
<field name="help">Congratulations, you have nothing to do !</field>
</record>

<menuitem id="menu_workflow_task" parent="mail.mail_feeds" sequence="15" action="open_workflow_task"/>
<menuitem id="menu_main_workflow_task" sequence="0" name="Tasks Dashboard"/>
<menuitem id="menu_group_workflow_task" parent="menu_main_workflow_task" sequence="0" name="Tasks"/>
<menuitem id="menu_workflow_task" parent="workflow_task.menu_group_workflow_task" sequence="15" action="open_workflow_task"/>
</data>
</openerp>

0 comments on commit 3768e23

Please sign in to comment.