diff --git a/addons/project/project.py b/addons/project/project.py index b75a0e2fa95..fdffb68ed86 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -556,6 +556,12 @@ class task(osv.osv): res[task.id] = False return res + def _compute_displayed_image(self, cr, uid, ids, prop, arg, context=None): + res = {} + for line in self.browse(cr, uid, ids, context=context): + res[line.id] = line.attachment_ids and line.attachment_ids.filtered(lambda x: x.file_type_icon == 'webimage')[0] or None + return res + _columns = { 'active': fields.function(_is_template, store=True, string='Not a Template Task', type='boolean', help="This field is computed automatically and have the same behavior than the boolean 'active' field: if the task is linked to a template or unactivated project, it will be hidden unless specifically asked."), 'name': fields.char('Task Summary', track_visibility='onchange', size=128, required=True, select=True), @@ -592,7 +598,9 @@ class task(osv.osv): 'id': fields.integer('ID', readonly=True), 'color': fields.integer('Color Index'), 'user_email': fields.related('user_id', 'email', type='char', string='User Email', readonly=True), - } + 'attachment_ids': fields.one2many('ir.attachment', 'res_id', domain=lambda self: [('res_model', '=', self._name)], auto_join=True, string='Attachments'), + 'displayed_image_id': fields.function(_compute_displayed_image, relation='ir.attachment', type="many2one", string='Attachment'), + } _defaults = { 'stage_id': _get_default_stage_id, 'project_id': lambda self, cr, uid, ctx=None: ctx.get('default_project_id') if ctx is not None else False, diff --git a/addons/project/project_dashboard.xml b/addons/project/project_dashboard.xml index b97e9721187..9d23ad05f40 100644 --- a/addons/project/project_dashboard.xml +++ b/addons/project/project_dashboard.xml @@ -27,7 +27,7 @@
- +
@@ -41,16 +41,14 @@
Cumulative Flow
-
-
-
-
    • +
      +
  • - More + More
    diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index e4e9a752fc6..36ff5bccf03 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -7,6 +7,7 @@ id="base.menu_main_pm" groups="group_project_manager,group_project_user" icon="fa-calendar" + web_icon="project,static/description/icon.png" sequence="50"/> +
    + + +
    -
    - - -
    @@ -254,7 +255,6 @@ - project.task.form project.task @@ -266,17 +266,15 @@ options="{'fold_field': 'fold'}"/> -
    -

    - - -

    -
    - +

    + + + -

    +
    @@ -357,29 +355,35 @@ +
    -
    - -
      + + -
      -
      + +
      +
      + +
      +

      oe_kanban_text_red
      -
      +
      @@ -387,10 +391,12 @@
      -
      +
      + +
    @@ -571,7 +577,7 @@

    You can also give a tooltip about the use of the stars available in the kanban and form views.

    -