Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3963 Widoki

I'm trying to write the _read_group_state function in order to displays all states columns in Kanban even if there is no record.

here is the code i tryed: 

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

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

can you help me?

Awatar
Odrzuć
Najlepsza odpowiedź

Hello,

There is a workaround documented by Ludwik Trammer on his blog that worked in my context.
I hope it will be helpful for you.

http://ludwiktrammer.github.io/odoo/odoo-grouping-kanban-view-empty.html

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
mar 15
4597
1
sty 25
1781
0
sie 22
2652
0
mar 22
2626
1
paź 19
5564