Odoo Help


Full groups / stages in Kanban view _group_by_full

Lucas Huber
on 2/12/16, 7:11 AM 1,725 views

I did try several solutions to including empty groups in my Kanban view.

First I did copy more or less the OSV solution from the Odoo Project module. But that didn't work:

def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_righ        ts_uid=None, context=None):    
    if context is None: context = {}
    stage_obj = self.pool.get('project.task.type')
    order = stage_obj._order
    access_rights_uid = access_rights_uid or uid
    if read_group_order == 'state_def desc':
        order = '%s desc' % order
    if 'default_project_id' in context:
         search_domain = ['|', ('project_ids', '=', context['default_project_id']), ('id            ', 'in', ids)]
         search_domain = [('id', 'in', ids)]
    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])))
    fold = {}
       for stage in stage_obj.browse(cr, access_rights_uid, stage_ids, context=context): fold[stage.id] = stage.fold or False
    return result, fold
_group_by_full = { 'stage_id': _read_group_stage_ids, }

But then I found a simpler solution according the tutorial from Ludwik Trammer.


def _read_group_stage_ids(self, present_ids, domain, **kwargs):
    # project_id = self._resolve_project_id_from_context()
    result = self.env['project.task.type'].search([]).name_get()
    return result, None

_group_by_full = { 'stage_id': _read_group_stage_ids, }

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 2/12/16, 7:11 AM
Seen: 1725 times
Last updated: 6/23/17, 10:54 AM