4

Is it possible to show groups (columns) without any items in Kanban view of Odoo10?

I found an article how to do that in Odoo8, but the way that is described there doesn't seem to work anymore.

Aidas Bendoraitis
  • 3,965
  • 1
  • 30
  • 45

2 Answers2

5

In odoo 10 group_by_default is replaced by group_expand and it takes list of all your stages. for e.g your columns are stage and you want to show all empty stages.

@api.model
def _read_group_stage_ids(self,stages,domain,order):
    stage_ids = self.env['stage.stage'].search([])
    return stage_ids

stage = fields.Many2one('stage.stage', group_expand='_read_group_stage_ids')
maharshi
  • 586
  • 12
  • 30
  • 1
    What if my stage is a Selection field? Or should I always use a Many2one relation for a stage? – Aidas Bendoraitis Nov 23 '16 at 15:39
  • Since ATM there seems to be no doc on group_expand, take a look at odoo/models.py and search for _read_group_fill_results. This is where group_expand gets interpreted. – Jerther May 31 '17 at 12:43
1

"_read_group_stage_ids " method return a list of stages so in your case try to pass all selection fields object in list form to group_expand method .

Anoop
  • 11
  • 1