[FIX]project: show tasks of project that are in template state when clicking on the show task button from the project.

bzr revid: csn@openerp.com-20130516101616-g4unvwc2e1dxb5dc
This commit is contained in:
Cedric Snauwaert 2013-05-16 12:16:16 +02:00
parent 5ceb9a84da
commit 231103feeb
2 changed files with 3 additions and 2 deletions

View File

@ -199,7 +199,8 @@ class project(osv.osv):
def _task_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict.fromkeys(ids, 0)
task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)])
context['active_test'] = False
task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)], context=context)
for task in self.pool.get('project.task').browse(cr, uid, task_ids, context):
res[task.project_id.id] += 1
return res

View File

@ -50,7 +50,7 @@
<field name="name">Tasks</field>
<field name="res_model">project.task</field>
<field name="view_mode">kanban,tree,form,calendar,gantt,graph</field>
<field name="context">{'search_default_project_id': [active_id], 'default_project_id': active_id}</field>
<field name="context">{'search_default_project_id': [active_id], 'default_project_id': active_id, 'active_test': False}</field>
<field name="search_view_id" ref="view_task_search_form"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">