[FIX] project, project_issue: when no project in context, display default
columns in kanban view. Also fixed some issues in the issue kanban view.
This commit is contained in:
@@ -686,12 +686,13 @@ class task(osv.osv):
|
||||
search_domain = []
|
||||
project_id = self._resolve_project_id_from_context(cr, uid, context=context)
|
||||
if project_id:
|
||||
search_domain += ['|', ('project_ids', '=', project_id)]
|
||||
search_domain += [('id', 'in', ids)]
|
||||
search_domain += ['|', ('project_ids', '=', project_id), ('id', 'in', ids)]
|
||||
else:
|
||||
search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)]
|
||||
stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context)
|
||||
result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context)
|
||||
# restore order of the search
|
||||
result.sort(lambda x,y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
|
||||
result.sort(lambda x, y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
|
||||
|
||||
fold = {}
|
||||
for stage in stage_obj.browse(cr, access_rights_uid, stage_ids, context=context):
|
||||
|
||||
@@ -113,13 +113,14 @@ class project_issue(osv.Model):
|
||||
search_domain = []
|
||||
project_id = self._resolve_project_id_from_context(cr, uid, context=context)
|
||||
if project_id:
|
||||
search_domain += ['|', ('project_ids', '=', project_id)]
|
||||
search_domain += [('id', 'in', ids)]
|
||||
search_domain += ['|', ('project_ids', '=', project_id), ('id', 'in', ids)]
|
||||
else:
|
||||
search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)]
|
||||
# perform search
|
||||
stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context)
|
||||
result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context)
|
||||
# restore order of the search
|
||||
result.sort(lambda x,y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
|
||||
result.sort(lambda x, y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
|
||||
|
||||
fold = {}
|
||||
for stage in stage_obj.browse(cr, access_rights_uid, stage_ids, context=context):
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
<field name="model">project.issue</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban default_group_by="stage_id">
|
||||
<field name="stage_id" options='{"group_by_tooltip": {"Description": "description", "Use of stars": "legend_priority"}}'/>
|
||||
<field name="stage_id" options='{"group_by_tooltip": {"description": "Description", "legend_priority": "Use of stars"}}'/>
|
||||
<field name="color"/>
|
||||
<field name="priority"/>
|
||||
<field name="user_email"/>
|
||||
|
||||
Reference in New Issue
Block a user