diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-12-10 13:05:58 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-12-10 13:05:58 +0100 |
| commit | 82a495eed52a9f42e5b88caa52c20a85f8d81ce3 (patch) | |
| tree | 6c5e8cc0247d5fe08d24e9abae38fe353fbebc56 /addons/project/project.py | |
| parent | 0bc2ddae784bf80c4c809d8b7f6d642d576f92a1 (diff) | |
| parent | 4022493c0b85f966e499b6c03ac7cce5556f15e6 (diff) | |
[MERGE] forward port of branch saas-7 up to 4022493
Diffstat (limited to 'addons/project/project.py')
| -rw-r--r-- | addons/project/project.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/project/project.py b/addons/project/project.py index e9dc6c06508..ecfb8f0b975 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -112,6 +112,14 @@ class project(osv.osv): for project in self.browse(cr, uid, ids, context=context): res[project.id] = len(project.task_ids) return res + + def _task_needaction_count(self, cr, uid, ids, field_name, arg, context=None): + Task = self.pool['project.task'] + res = dict.fromkeys(ids, 0) + projects = Task.read_group(cr, uid, [('project_id', 'in', ids), ('message_needaction', '=', True)], ['project_id'], ['project_id'], context=context) + res.update({project['project_id'][0]: int(project['project_id_count']) for project in projects}) + return res + def _get_alias_models(self, cr, uid, context=None): """ Overriden in project_issue to offer more options """ return [('project.task', "Tasks")] @@ -163,6 +171,7 @@ class project(osv.osv): 'resource_calendar_id': fields.many2one('resource.calendar', 'Working Time', help="Timetable working hours to adjust the gantt diagram report", states={'close':[('readonly',True)]} ), 'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages', states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'task_count': fields.function(_task_count, type='integer', string="Tasks",), + 'task_needaction_count': fields.function(_task_needaction_count, type='integer', string="Tasks",), 'task_ids': fields.one2many('project.task', 'project_id', domain=['|', ('stage_id.fold', '=', False), ('stage_id', '=', False)]), 'color': fields.integer('Color Index'), |
