Odoo Help


How to display group column with no data in OpenERP 7's Kanban View ?

on 9/9/13, 6:57 AM 6,017 views

I want to ask something here about Kanban View in OpenERP 7,

I'm creating a Kanban view for my module. the view is grouped by 4 stage of columns, so when I drag a record to another column the stage of that record will be changed.

but here's the problem: I want to drag a record from stage A to stage B. but when there's no record in stage B the stage B's column will not be displayed until I've a record with stage B , so I can't change the stage by dragging the record because the stage B's column is not visible

so desperate to find the solution, please help me.. thanks guys,

It affects me too

Denis Karataev
on 12/22/13, 1:34 PM
Mathieu Benoit
On 2/17/14, 6:12 PM

(Note: I add space on my link because the forum block my post if contain links) I found this : http:// stackoverflow.com/questions/18680375/display-column-with-no-record-in-openerp-7-kanban-view

In the view, you have this : <kanban default_group_by="stage_id">

You need to specify how sort the group in your class.

def _read_group_state(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None): pass

_group_by_full = { 'stage_id': _read_group_stage_ids}

You can check example with crm_lead: View example: http:// bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/crm/crm_lead_view.xml (search

<record model="ir.ui.view" id="crm_case_kanban_view_leads">

) Sort example: http:// bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/crm/crm_lead.py (search

_group_by_full = { 'stage_id': _read_group_stage_ids }


I notice, your stage_id is suppose to be an M2O (or whatever key you want to group by).

Bréndou Serge Eric
On 6/2/14, 1:10 PM

Please Mathieu Benoit! can you show us how _read_group_state function should look like?

here is the his mine: 

def _read_group_state(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
        print '_read_group_state'
        access_rights_uid = access_rights_uid or uid
        renting_obj = self.pool.get('mymodule.renting')
        renting_ids = renting_obj._search(cr, uid, domain, order=read_group_order, access_rights_uid=access_rights_uid, context=context)
        result = renting_obj.name_get(cr, access_rights_uid, renting_ids, context=context)
        result.sort(lambda x,y: cmp(renting_ids.index(x[0]), renting_ids.index(y[0])))
        states = {}
        for renting in renting_obj.browse(cr, access_rights_uid, renting_ids, context):
            states[renting.id] = renting.state or False
        return result, states

that return next error : AssertionError: M2O-like pair expected, got u'draft'

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

2 follower(s)


Asked: 9/9/13, 6:57 AM
Seen: 6017 times
Last updated: 6/23/17, 10:55 AM