[FIX] project: do not hide tasks from template project in the project kanban and if we open those tasks from the project template

bzr revid: qdp-launchpad@openerp.com-20130516121306-3d24o7z9y8odmvqh
This commit is contained in:
Quentin (OpenERP) 2013-05-16 14:13:06 +02:00
commit b6a4e2fc5f
2 changed files with 6 additions and 2 deletions

View File

@ -198,8 +198,12 @@ class project(osv.osv):
return res
def _task_count(self, cr, uid, ids, field_name, arg, context=None):
if context is None:
context = {}
res = dict.fromkeys(ids, 0)
task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)])
ctx = context.copy()
ctx['active_test'] = False
task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)], context=ctx)
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">