diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index d82bc0e5c29..3d9c14bb860 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -82,14 +82,17 @@ class crm_lead(base_stage, osv.osv): # lame hack to allow reverting search, should just work in the trivial case if read_group_order == 'stage_id desc': order = "%s desc" % order - # retrieve type from the context (if set: choose 'type' or 'both') - type = self._resolve_type_from_context(cr, uid, context=context) # retrieve section_id from the context and write the domain + # - ('id', 'in', 'ids'): add columns that should be present + # - OR ('case_default', '=', True), ('fold', '=', False): add default columns that are not folded + # - OR ('section_ids', '=', section_id), ('fold', '=', False) if section_id: add section columns that are not folded search_domain = [] section_id = self._resolve_section_id_from_context(cr, uid, context=context) if section_id: search_domain += ['|', '&', ('section_ids', '=', section_id), ('fold', '=', False)] - search_domain += ['|', ('id', 'in', ids), '&', ('case_default', '=', 1), ('fold', '=', False)] + search_domain += ['|', ('id', 'in', ids), '&', ('case_default', '=', True), ('fold', '=', False)] + # retrieve type from the context (if set: choose 'type' or 'both') + type = self._resolve_type_from_context(cr, uid, context=context) if type: search_domain += ['|', ('type', '=', type), ('type', '=', 'both')] # perform search diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 6c361cf0bfd..d4fe6325917 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -131,7 +131,10 @@ class hr_applicant(base_stage, osv.Model): # lame hack to allow reverting search, should just work in the trivial case if read_group_order == 'stage_id desc': order = "%s desc" % order - # get department_id from context + # retrieve section_id from the context and write the domain + # - ('id', 'in', 'ids'): add columns that should be present + # - OR ('department_id', '=', False), ('fold', '=', False): add default columns that are not folded + # - OR ('department_id', 'in', department_id), ('fold', '=', False) if department_id: add department columns that are not folded department_id = self._resolve_department_id_from_context(cr, uid, context=context) search_domain = [] if department_id: diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 2aa9195ce19..a94a12add6e 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -84,11 +84,14 @@ class project_issue(base_stage, osv.osv): if read_group_order == 'stage_id desc': order = "%s desc" % order # retrieve section_id from the context and write the domain + # - ('id', 'in', 'ids'): add columns that should be present + # - OR ('case_default', '=', True), ('fold', '=', False): add default columns that are not folded + # - OR ('project_ids', 'in', project_id), ('fold', '=', False) if project_id: add project columns that are not folded search_domain = [] project_id = self._resolve_project_id_from_context(cr, uid, context=context) if project_id: - search_domain += ['|', '&', ('project_ids', '=', project_id), ('fold', '=', True)] - search_domain += ['|', ('id', 'in', ids), '&', ('case_default', '=', 1), ('fold', '=', False)] + search_domain += ['|', '&', ('project_ids', '=', project_id), ('fold', '=', False)] + search_domain += ['|', ('id', 'in', ids), '&', ('case_default', '=', True), ('fold', '=', False)] # 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)